I've got an escorts catagory with some links on it.... I want to use javascript to alert users that they should be 18 before continuing to the webpage... Does anyone have a javascript code that will do what I am looking for
<script type="text/javascript"> <!-- var answer = confirm ("Please click on OK to continue loading this page of paid sexual encounters, or CANCEL to be directed to Disney.") if (!answer) window.location="http://www.disney.com/" // --> </script> Code (markup):
ok - I saved that code, but it's not exactly what I was looking for.... I want to assign something like that to a link on a page but not the entire page itself... Each escort link should open a box when clicked which you must okay to continue.... Got anything else?
Sure, I use it that way a lot when deleting items from a list. <script language="javascript"> function verify(t,qs) { var agree=confirm("Are you sure you want to go to this page: '"+t+"'?"); if (agree) location.href=qs ; } </script> <a href="#" onclick="verify('Escorts page','http://www.lotsahotgirls.com/');">Click here</a>