我正在使用在IE8中开发和测试的使用JQuery的解决方案。JQuery和IE8,兼容模式和IE7仿真
我有一个用户,在“工具”>“兼容性视图设置”下显示了“在兼容性视图中显示所有网站”。部分JQuery失败。
$(document).ready(function() {
// creating named variables to represent the throbber objects to make life easier later.
var moSearchThrobber = $("#imgSearchThrobber");
var moFilterThrobber = $("#imgFilterThrobber");
//lets hide the search and filter dialogs.
$("div[id*=pnlSearch_Dialog]").hide();
$("div[id*=pnlFilter_Dialog]").hide();
// when I change the value of my drop downs in search and in filter, set the hidden field value.
$("select[name=ddlValue]").change(function() {
$(this).siblings("input:hidden").val($(this).val());
});
// If the user clicks on the Search link button.
$("a[id*=lnkSearch").click(function() {
// while we are at it turn on the search throbber
moSearchThrobber.css('visibility', 'visible');
// find the search grid and get/each through all the rows.
$("table[id*=grdSearch]").find("tr").each(function() {
的隐藏功能工作...但点击方法不火......
我一直在寻找试图迫使它进入IE8,并通过meta标签关闭兼容模式。 ..但是这对我来说很肮脏。现在还有其他的选择让jquery在IE8的所有3个“版本”中都一样吗?
您是否收到错误消息?当你说它“失败”时,你的意思是什么? – gilly3 2012-02-02 20:05:39
没有错误...它只是没有发生火灾 – Patrick 2012-02-02 20:17:26
填充代码中的空白,这在IE9兼容性视图中工作:http://jsfiddle.net/WyyUe/。请注意,您在'lnkSearch'选择器中缺少一个末端括号('''),但无论是否在兼容性视图中都会打破它,所以我猜测这只是一个错字。你可以发布一个jsfiddle来看你的bug吗? – gilly3 2012-02-02 20:39:13