VineetDubey Posted June 19, 2011 Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='submit' onClick='do()' /> </body> </html> Link to comment https://forums.phpfreaks.com/topic/239788-why-this-code-is-not-working/ Share on other sites More sharing options...
VineetDubey Posted June 19, 2011 Author Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='submit' onClick='do()' /> </body> </html> This code is not working please anyone can help me to sort this out Link to comment https://forums.phpfreaks.com/topic/239788-why-this-code-is-not-working/#findComment-1231738 Share on other sites More sharing options...
efficacious Posted June 19, 2011 Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='button' onclick='do()' value='CLICK ME!' /> </body> </html> Link to comment https://forums.phpfreaks.com/topic/239788-why-this-code-is-not-working/#findComment-1231867 Share on other sites More sharing options...
Adam Posted June 19, 2011 Share Posted June 19, 2011 'do' is a reserved name in JavaScript - look into 'do .. while' loops. Link to comment https://forums.phpfreaks.com/topic/239788-why-this-code-is-not-working/#findComment-1231875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.