Ticket #10565 (closed bug: invalid)
IE8: JQuery .find() fct:: "unexpected call to method or property access"
| Reported by: | Filip | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
I'm having some problems with getting one of my site pages with IE8. It works fine in IE9, Safari (both PC & Mac) & Firefox (Mac). I'm using a .find(tag1).html(tag1) call sequence to do a title substitution, but I get the following error in IE8 when I debug it in the IE script debugger, and this in the .html(tag2) fct.:
Unexpected call to method or property access
The .find(tag1) fct. seems to return the enclosing object (i.e. "#sidebar"), rather than the nested object ("#sidebarheader"), and this causes problems when later making the .html(tag2) call.
I've created a representative test case as follows:
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JQuery .find() test case</title>
<script type="text/javascript" src=" http://code.jquery.com/jquery-1.6.4.js"></script>
<script type="text/javascript">
function UpdateHeader() {
$('#sidebar').find('header').html("New Title"); IE8, nesting div's in the find fct. will not discover the child div
}
</script>
</head> <body>
<div style="height: 400px; width: 390px">
<div id="jqm-home">
<div id="page">
<div id="sidebar">
<div id="sidebarheader">
<header>Old Title</header>
</div>
</div>
</div>
<p onclick="UpdateHeader();">Click to update title</p> </div>
</div>
</body> </html>
Has anybody a suggestion on how to get this to work in IE8?
Thanks,
Filip
Change History
comment:2 Changed 19 months ago by dmethvin
IE6/7/8 doesn't support HTML5, and you're using the header tag. You need a shiv/shim, which is beyond the scope of the bug tracker, so ask for help on the forum. http://forum.jquery.com
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

And here is the jsFiddle test case:
Filip