Skip to main content

Bug Tracker

Side navigation

#5005 closed bug (duplicate)

Opened August 03, 2009 05:17PM UTC

Closed February 18, 2011 01:41PM UTC

Last modified March 13, 2012 06:06PM UTC

jQuery 1.3.2 and nightly HTML title change bug in IE8

Reported by: mrsugar Owned by:
Priority: low Milestone:
Component: manipulation Version: 1.3.2
Keywords: ie8 html title unexpected call to method Cc:
Blocked by: Blocking:
Description

Hi guys,

I was working on changing html title via a small script using this following method:

$("html title").html(docTitle+" | "+currentTitle);

That throw an "unexpected call to method or property access" error in IE8. After switching the method to:

document.title = docTitle+" | "+currentTitle;

The error went away. Not sure if this is IE or Jquery.

Attachments (0)
Change History (5)

Changed August 04, 2009 12:33AM UTC by matthawke comment:1

I experienced a similar issue today in IE8 with the following code:

$("title").html("Lorem ipsum");

Using jQuery unminified rev 6246 I tracked the error down to the append: function on lines 252-257. Turns out that when the tagName is TITLE, line 255 throws an error.

The original function is:

append: function() {
	return this.domManip(arguments, true, function(elem){
		if (this.nodeType == 1)
			this.appendChild( elem );
	});
},

I edited the function (naturally, thereby killing the functionality with respect to titles) and made the error go away:

append: function() {
	return this.domManip(arguments, true, function(elem){
		if (this.nodeType == 1 && this.tagName != "TITLE")
			this.appendChild( elem );
	});
},
document.title = "Lorem Ipsum"
does indeed work correctly.

Hope that helps...

Changed June 13, 2010 02:25PM UTC by dmethvin comment:2

resolution: → worksforme
status: newclosed

The correct cross-browser way to alter the title is by assigning to the document.title property.

Changed February 18, 2011 01:41PM UTC by jitter comment:3

component: unfiledmanipulation
milestone: 1.3.2
priority: minorlow
resolution: worksforme
status: closedreopened

Changed February 18, 2011 01:41PM UTC by jitter comment:4

resolution: → duplicate
status: reopenedclosed

Changed February 18, 2011 01:41PM UTC by jitter comment:5

Duplicate of #2755.