[英]javascript script works in Firefox, Chrome, Safari, Internet Explorer < 9, but not in IE 9
[英]JavaScript alert works normally Firefox, but not in Chrome and Explorer
我的页面上有简单的jQuery代码和“显示警报”按钮
当我单击“显示警报”按钮时; 页面的所有设计都失真了。 它可以在Firefox上正常运行,但不能在Chrome和Explorer中运行。
plaese参考问题链接: http : //bit.ly/1vnHPU2
$(function() {
$("#buttonAlert").click( function()
{
alert('button clicked');
}
);
});
编辑:
i在页面上清除了脚本块的所有单击功能。 但是问题没有解决。
谢谢!
添加标签按钮类型时出现问题
<button class="btn btn-primary btn-block" id="buttonAlert" name="buttonAlert" > Show Alert </button>
至
<button type="button" class="btn btn-primary btn-block" id="buttonAlert" name="buttonAlert" > Show Alert </button>
感谢所有朋友对此问题感兴趣。
$(function() {
$("#buttonAlert").on("click", function()
{
alert('button clicked');
}
);
});
尝试一下,有时我只遇到“ .click()”问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.