helloise Posted May 4, 2011 Share Posted May 4, 2011 i have this line in my code: echo '<a href="" onClick="yesnolist()">Free Chat</a>'; then at the top i have: <? php //have some php here ?> <div class="innerContainer"> <head> <script type="text/JavaScript"> function yesnolist(val) { alert("lakjsd"); var e = confirm('Do you want to send a free chat request?'); if (e == true) { window.location.href = "http://www-rainbowcode-mobi/confirmfreechat.php"; window.location('http://www-rainbowcode-mobi/confirmfreechat.php'); return true; } else return false; } </script> </head> <span class="headings2">CONTACTS</span> //and more code after this echo '<a href="" onClick="yesnolist()">Free Chat</a>'; why is it not doing my onClick()?? please help? thanks Link to comment https://forums.phpfreaks.com/topic/235490-javascript-for-onclick-not-executing/ Share on other sites More sharing options...
freelance84 Posted May 4, 2011 Share Posted May 4, 2011 What does happen? Have you tried running the script/page in ie? Although i hate IE it does give an indication as to where the error is in js Link to comment https://forums.phpfreaks.com/topic/235490-javascript-for-onclick-not-executing/#findComment-1210306 Share on other sites More sharing options...
trq Posted May 4, 2011 Share Posted May 4, 2011 Although i hate IE it does give an indication as to where the error is in js Pfff. Use firebug to debug JavaScript. Link to comment https://forums.phpfreaks.com/topic/235490-javascript-for-onclick-not-executing/#findComment-1210309 Share on other sites More sharing options...
freelance84 Posted May 4, 2011 Share Posted May 4, 2011 Although i hate IE it does give an indication as to where the error is in js Pfff. Use firebug to debug JavaScript. Nice one cheers. I didnt know that about firebug.... bye bye ie Link to comment https://forums.phpfreaks.com/topic/235490-javascript-for-onclick-not-executing/#findComment-1210329 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.