Confirm Pop Up Window
Then Redirect To Link

T hese little sniplets of Java script are really quite cool. When someone clicks on a link a pop up will appear with an accept or cancel. If you click "Cancel" the pop up will just go away. If you accept you will be taken to the link. This will also work with email. Below are all the different examples with script reconfigurations to show you how easy it is.

With these little sniplets you can change the text that is color coded. Everything else must stay as is or it will not function properly. If you notice on the second ( 2nd ) code below there is also a target="_blank" attribute. if you click on that link you will see a new window open behind the "Pop Up". If you click "cancel" the window will show
"Page cannot be displayed"   (  for obvious reasons  )   If you don't want this to open in a new window just do not use that attribute.

Email Reconfigurations

Email Webmaster

<a href="javascript:if(confirm('If you would like to email the Webmaster of this
site Click
\'OK\' to email Him/Her with what ever is on your mind'))
window.location='mailto:Your Email Address';"> Email Webmaster</a>

Link Reconfigurations

Support     Will Open In New Window

Support     Will Open In same Window

<a href="javascript:if(confirm('If you would like On Line Support with the staff
of The Consigliere™ Ltd. Click
\'OK\' to open our support lines'))
window.location='YOUR URL TO LINK ';"target="_blank">Support</a>

\'OK\' If you notice how the apostrophy is used to create a single quote. You cannot use the " character in this script and if you use the single ' you have to write is as the example shows or you will get an error on your page.

Back To Our Alphabet Index

Yahoo! On Line Presence

Live On Line Support

Advanced Site Search


If you are part of the ever growing number of webmasters who enjoy sharing your knowledge with others on web design, join The Consigliere's™ Ltd. web ring to broaden your scope of exposure.
Join Today

This Site Was Built And Is Maintained Exclusively by

Copyright © 2001, The Consigliere™ Ltd., All Rights Reserved.