开发者

JavaScript Button.click() does not work in Firefox, works fine in Internet Explorer

I have an ASP.NET button on my page. When I click the button using JavaScript (buttonId.click()), Firefox seems to fire all onc开发者_StackOverflow社区lick event handlers on the page. I would like to click only one button.

This scenario is working fine in Internet Explorer.

Please let me know of any workarounds for this.

Thanks


The simple workaround is:

  1. Make a div, height 100% of the page, width 100% of the page.
  2. This div is hidden.
  3. Make a function showDiv() that shows your div.
  4. On every action in your page you'll use a JavaScript function.
  5. The last row of all JavaScript function is showDiv().

Then after every click that calls a JavaScript function other clicks on this page are disabled.

Ps. Obviously the div need remains align to viewport (top=0;left=0).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜