Alert Message! - Post ID 835

User 310011 Photo


Trial User
25 posts

can you gave me the java script for alert message that has Yes and No button if they push Yes they will be redirect to other site and also with No and can i put a image in may alert message? thnx.
User 364143 Photo


Guest
5,410 posts

<script type="text/javascript">
<!--
var answer = confirm ("Do you like CoffeeCup?")
if (!answer)
window.location="http://www.adobe.com/"
else
window.location="http://www.coffeecup.com/"
// -->
</script>
CoffeeCup... Yeah, they are the best!
User 310011 Photo


Trial User
25 posts

thnx for the code, but can i put a image like this one?:

http://i38.photobucket.com/albums/e129/ryaleen11/ren-6.jpg

what code should i put?
----------------------------------------------------------
<script type="text/javascript">
<!--
var answer = confirm ("Do you like CoffeeCup?")
if (!answer)
window.location="http://www.adobe.com/"
else
window.location="http://www.coffeecup.com/"
// -->
</script>
-----------------------------------------------------------
User 364143 Photo


Guest
5,410 posts

I don't think you can use a basic alert box like that.

Here is a link to create a custom alert box but it's a bit complicated.

http://slayeroffice.com/code/custom_alert/

You can also go about that a different way. You can create a Hidden floating div the correct size and position where you want the message to display. Put the image and buttons in there. Then display the div whenever you want the "pop-up".

http://willmaster.com/blog/css/show-hid … g_div.html
CoffeeCup... Yeah, they are the best!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.