开发者

Chrome JavaScript click()

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜