简体   繁体   English

Jquery事件处理程序没有触发

[英]Jquery event handler not firing

I have a web page that is having some javascript issues. 我有一个网页,有一些JavaScript问题。 I have tried looking over everything however I have a username field and when you click it ( .focus ) it should bring up a pop up. 我已经尝试查看所有内容但是我有一个用户.focus段,当你点击它( .focus )它应该弹出一个弹出窗口。 I used firebug in firefox to put break points right then the .focus function is called and it it is not fired even though I do focus on the username field. 我在firefox中使用firebug来放置断点,然后调用.focus函数,即使我专注于用户名字段也不会触发它。 I have also looked over spelling and everything. 我也看过拼写和一切。 Cant seem to find the issue. 似乎无法找到问题。 Hope someone can help. 希望有人能提供帮助。 One more thing, this issue is happening in all browsers. 还有一件事,这个问题在所有浏览器中都会发生。

page link: http://aliahealthcareer.com/SignUp 页面链接: http//aliahealthcareer.com/SignUp

Your page has two inputs with id="username" . 您的页面有两个输入, id="username"

Repeating ids is invalid html, but the browser kind of ignores it except that $('#username') finds only the first one so your .focus() handler is bound to that one. 重复id是无效的html,但是浏览器忽略了它,除了$('#username')只找到第一个,所以你的.focus()处理程序绑定到那个。

The first is within the "login_response" div that is hidden until you click the "Login" option, so if you click "Login" and then click the "Username/Email" field that appears you'll see that your event handler runs. 第一个是在“login_response”div中隐藏,直到您单击“登录”选项,因此如果单击“登录”然后单击出现的“用户名/电子邮件”字段,您将看到您的事件处理程序运行。

You have JS issues on load of that page. 您在加载该页面时遇到JS问题。 JS wont work properly thereafter. JS之后不会正常工作。 You need to fix those first. 你需要先修复它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM