开发者

Chrome JavaScript click()

开发者 https://www.devze.com 2023-04-11 09:26 出处:网络
The following .NET VB code (that generates JavaScript in the browser) works great for capturin开发者_C百科g the Enter key and firing the login button in FF, and IE but not in Chrome:

The following .NET VB code (that generates JavaScript in the browser) works great for capturin开发者_C百科g the Enter key and firing the login button in FF, and IE but not in Chrome:

password.Attributes.Add("onkeydown", "if(event.which || event.keyCode || event.charCode){if ((event.which == 13) || (event.keyCode == 13) || (event.charCode == 13)) {document.getElementById('" & loginButton.ClientID & "').click();return false;}} else {return true}; ")

It gets the event.keyCode ok but that's it. So I'm guessing it's an issue with the button.click() part.

Does anyone have a clue if it's possible to work around this?

0

精彩评论

暂无评论...
验证码 换一张
取 消