Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery选择器ie8问题_Javascript_Jquery_Css_Internet Explorer 8 - Fatal编程技术网

Javascript jquery选择器ie8问题

Javascript jquery选择器ie8问题,javascript,jquery,css,internet-explorer-8,Javascript,Jquery,Css,Internet Explorer 8,我在jquery中有以下语句,它在Chrome v.22和Firefox v.16上都能完美地工作,但在IE8上不起作用;声明如下: 第一种方法: $("div[aria-labelledby='myOwnAriaLabelledBy']").css('height',450); 第二种方法: $("div[aria-labelledby='myOwnAriaLabelledBy']").attr('id','test'); $("#test").css('height',450); 这是h

我在jquery中有以下语句,它在Chrome v.22和Firefox v.16上都能完美地工作,但在IE8上不起作用;声明如下:

第一种方法:

$("div[aria-labelledby='myOwnAriaLabelledBy']").css('height',450);
第二种方法:

$("div[aria-labelledby='myOwnAriaLabelledBy']").attr('id','test');
$("#test").css('height',450);
这是html,我不能包含类:

<div style="display: block; z-index: 1006; outline: 0px none; 
position: absolute; height: 490.333px; width: 600.333px; 
top: 10px; left: 10px;" 
tabindex="-1" role="dialog" aria-labelledby="myOwnAriaLabelledBy">

有人知道这种选择器是否知道IE8存在问题吗?
谢谢

您的页面呈现是兼容模式还是怪癖模式

我不是100%确定,但我记得IE8支持根据渲染模式的不同而变化的aria属性

尝试使用camelCase选择器,例如

$("div[ariaLabelledBy='myOwnAriaLabelledBy']").css('height',450);

这可能只是普通Javascript的问题,但也可能是导致jQuery出错的原因。我认为这与将“-”字符解释为减号有关。

查看视图源代码并检查是否呈现了aria labelledby的那些属性。jQuery是否附带一些HTML?检查与此的差异,这似乎起到了作用。我看到了小提琴,是否有可能是某些类导致了这个问题?尝试向特定的div添加一个id,并使用jquery来更改css。如果这样做有效,那么问题出在您的选择器上。如果不是,它与您的其他标记或样式有关。