简体   繁体   English

IE9:按钮表现出奇怪的行为而不是第一次点击,仅在IE9中

[英]IE9: button exhibiting odd behavior and not working on first click, only in IE9

I'm having an issue that I can only reproduce in IE 9, but I have no idea why. 我有一个问题,我只能在IE 9中重现,但我不知道为什么。 When I click on a button in IE 9, if it is the first click on the freshly loaded page, the button will not register the event. 当我点击IE 9中的按钮时,如果是第一次点击新加载的页面,该按钮将不会注册该事件。 If my initial click is outside the button's area and I make a subsequent click on the button, the action is performed. 如果我的初始点击位于按钮区域之外,然后我再次单击按钮,则会执行操作。

<button type="button" title="Request Quote" class="button btn-quote" onclick="setLocation('/quotes?partsno=188122-B22&amp;mfg=HP&amp;cond=New');">
<span>
<span>Request Quote</span>
</span>
</button>

I can only reproduce the issue in IE9. 我只能在IE9中重现这个问题。 Spoofing Safari with a IE9 user agent string does not reproduce the issue, and the code can be altered to any valid javascript;the onclick still does not get invoked as expected. 使用IE9用户代理字符串欺骗Safari不会重现该问题,并且代码可以更改为任何有效的JavaScript; onclick仍然不会按预期调用。 An example can be found here , on the Request Quote button: 一个例子可以找到这里 ,就请求报价按钮:

http://www.itpartsconnection.com/hp-188122b22.html http://www.itpartsconnection.com/hp-188122b22.html

Thanks Much! 非常感谢!

Try the below syntax, that is semantic: 尝试以下语法,即语义:

<input type="button" title="Request Quote" value="Request Quote" class="button btn-quote" onclick="setLocation('/quotes?partsno=188122-B22&amp;mfg=HP&amp;cond=New');" />

Then, do all the CSS based into your button and btn-quote CSS classes, not the spams. 然后,将所有CSS基于您的buttonbtn-quote CSS类,而不是垃圾邮件。

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

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