[英]onclick event not working in firefox but works fine in IE
I got a simple form and it works fine in ie but not working in firefox 我有一个简单的表格,它可以在IE中正常工作,但不能在Firefox中工作
onclick="login('loginuser','../private/loginuser.php?username='+email.value+'&pass='+passw.value,'loginresult');"
Any help appreciated. 任何帮助表示赞赏。
You should start by putting some alert calls in your login function to make sure that your arguments are getting quoted properly. 您应该首先在登录函数中添加一些警报调用,以确保正确引用您的参数。 Something like
就像是
function login (username, password, result) {
alert(username);
alert(password);
alert(result);
.... rest of function
}
That's not really a form, just an attribute snippet. 那实际上不是表格,只是属性片段。 Install Firebug add-on for Firefox ( https://addons.mozilla.org/en-US/firefox/addon/1843/ ) and eliminate the guesswork by debugging the javascript.
安装适用于Firefox的Firebug插件( https://addons.mozilla.org/en-US/firefox/addon/1843/ ),并通过调试JavaScript消除猜测。 You can set a breakpoint in your login() function and see if everything is ok there or if at least if it gets called.
您可以在login()函数中设置一个断点,查看那里是否一切正常,或者至少是否被调用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.