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 Quote 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 Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.