straygrey Posted October 30, 2012 Share Posted October 30, 2012 Please tell me why the following html does not call the javascript submit_click() function. <!DOCTYPE html> <html> <head> <title>Page Title</title> <meta name="[url=""]viewport[/url]" content="[url=""]width=device-width,initial-scale=1[/url]"> <link rel="[url=""]stylesheet[/url]" type="[url=""]text/css[/url]" href="[url="view-source:http://localhost/prince/style/style.css"]style/style.css[/url]"/> <script language="[url=""]Javascript[/url]" type="[url=""]text/javascript[/url]" src="[url="view-source:http://localhost/prince/js/Diva.js"]js/Diva.js[/url]"></script> <style type="[url=""]text/css[/url]">a {text-decoration: none}</style> <script language=[url=""]javascript[/url]> function submit_click() { alert("Button Pressed"); progExe("logon.php?"uname="+uname+"&Passwrd="+passwrd); } </script> </head> <body> <!--- <form name="logon" ID="logon" action="logon.php" method="post"> --> <table align="[url=""]center[/url]" border="[url=""]3[/url]" cellspacing="[url=""]0[/url]" cellpadding="[url=""]3[/url]"> <tr><td>Username:</td><td> <input type="[url=""]text[/url]" name="[url=""]uname[/url]" id=[url=""]uname[/url] maxlength="[url=""]40[/url]" placeholder="[url=""]Enter your UserName[/url]" autofocus required> </td></tr> <tr><td>Password:</td> <td> <input type="[url=""]password[/url]" name="[url=""]passwrd[/url]" id=[url=""]passwrd[/url] maxlength="[url=""]50[/url]" placeholder="[url=""]Password[/url]" required> </td></tr> <tr><td colspan="[url=""]3[/url]" align="[url=""]center[/url]"> <button type="[url=""]button[/url]" onclick="[url=""]submit_click()[/url]">Logon</button> <a href="[url="view-source:http://localhost/prince/register.html"]register.html[/url]"><input type=[url=""]submit[/url] value="[url=""]RegisterSelf[/url]"> <a href="[url="view-source:http://localhost/prince/client.html"]client.html[/url]"><input type=[url=""]submit[/url] value="[url=""]RegisterClient[/url]"> </td></tr> </table> <center> <div id="[url=""]loadingNode[/url]";></div> </center> </body> </html> Quote Link to comment Share on other sites More sharing options...
OOP Posted October 30, 2012 Share Posted October 30, 2012 Hi there, I beleive the "language" attribute in script tag is obsolete in HTML5, remove it and that should solve your issue. Quote Link to comment Share on other sites More sharing options...
haku Posted October 31, 2012 Share Posted October 31, 2012 That's correct. It was actually deprecated in HTML4. Script tags for HTML 5 can be written simply as: <script></script> Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 31, 2012 Share Posted October 31, 2012 That won't stop the script from executing The script type declaration is optional, you can still include it. Quote Link to comment Share on other sites More sharing options...
haku Posted October 31, 2012 Share Posted October 31, 2012 We were speaking of 'language', not 'type'. That said, I agree that including (or not including) either of them shouldn't make a difference. But look at his current script tag: <script language=[url=""]javascript[/url]> Even assuming that the is some kind of bbcode/templating code, the script tag is messed up. Quote Link to comment 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.