Side navigation
#7025 closed bug (duplicate)
Opened September 10, 2010 11:24PM UTC
Closed February 18, 2011 01:40PM UTC
Last modified March 13, 2012 10:48PM UTC
Method .text() Works in Firefox, Fails in IE
Reported by: | rwadams | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | core | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Test page: http://www.hymntime.com/tch/htm/h/o/template.htm
Lines 91-92 of script hymn2.js read:
var titleElement = $("title");
var titleText = titleElement.text();
This correctly returns the document title in Firefox 3.6.9. However, in Internet Explorer 8.0.7600, the variable titleText is set to an empty string.
Attachments (0)
Change History (7)
Changed September 11, 2010 01:27AM UTC by comment:1
Changed September 11, 2010 03:18PM UTC by comment:2
Replying to [comment:1 miketaylr]:
This isn't really a bug, per se--the most reliable way of getting the text from the title across browsers is via document.title. In your example, var titleText = document.title;
Hmmm...I thought Jquery's goal was to give the same behavior across browsers, especially two major browsers like Firefox & IE? Oh well. I'm still unclear what causes the different results, but you're right: document.title does work. Guess we'll declare victory & let the Jquery folks scratch their heads about the different browser behaviors.
Changed September 12, 2010 01:13AM UTC by comment:3
resolution: | → worksforme |
---|---|
status: | new → closed |
There already is a cross-browser way to set and get the title,
document.title.
Changed September 23, 2010 11:10PM UTC by comment:4
I really disagree with the resolution of this bug.
Changed February 18, 2011 01:39PM UTC by comment:5
component: | unfiled → core |
---|---|
milestone: | 1.4.3 |
priority: | → low |
resolution: | worksforme |
status: | closed → reopened |
Changed February 18, 2011 01:40PM UTC by comment:6
resolution: | → duplicate |
---|---|
status: | reopened → closed |
This isn't really a bug, per se--the most reliable way of getting the text from the title across browsers is via document.title.
In your example,
var titleText = document.title;