开发者

dojo query does not work on IE7 but does on IE8 and other browsers?

开发者 https://www.devze.com 2023-02-22 11:05 出处:网络
dojo.query(\"#foo #bar\") which works as expected in FF, Safari, Chrome and IE8, returns an empty list in IE7.

dojo.query("#foo #bar") which works as expected in FF, Safari, Chrome and IE8, returns an empty list in IE7.

I'm actually searching for a div with id = bar inside another div with开发者_StackOverflow id = foo.

Did I miss something in my query or is this a known issue in IE7??

Thanks Jeff


Because ID's are unique you shouldn't ever had to query for two at once. So either modify your query and have a single ID, or, if you need multiple elements with the same 'id', use a class.

For the second option, you would then change your query to dojo.query('.bar', dojo.byId('foo')), which returns elements with class 'bar' that are a child of the element with id 'foo'.

0

精彩评论

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