Skip to main content

Bug Tracker

Side navigation

#10565 closed bug (invalid)

Opened October 24, 2011 02:25PM UTC

Closed October 27, 2011 10:19PM UTC

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:
Blocked by: Blocking:
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

Attachments (0)
Change History (3)

Changed October 24, 2011 03:05PM UTC by Filip comment:1

And here is the jsFiddle test case:

http://jsfiddle.net/bnmcK/21/

Filip

Changed October 27, 2011 10:18PM UTC by dmethvin comment:2

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

Changed October 27, 2011 10:19PM UTC by dmethvin comment:3

resolution: → invalid
status: newclosed