Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#7025 closed bug (duplicate)

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.

Change History (7)

comment:1 Changed 9 years ago by 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;

comment:2 in reply to:  1 Changed 9 years ago by rwadams

Replying to 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.

comment:3 Changed 9 years ago by dmethvin

Resolution: worksforme
Status: newclosed

There already is a cross-browser way to set and get the title, document.title.

comment:4 Changed 9 years ago by Pointy

I really disagree with the resolution of this bug.

comment:5 Changed 9 years ago by jitter

Component: unfiledcore
Milestone: 1.4.3
Priority: low
Resolution: worksforme
Status: closedreopened

comment:6 Changed 9 years ago by jitter

Resolution: duplicate
Status: reopenedclosed

comment:7 Changed 9 years ago by jitter

Duplicate of #2755.

Note: See TracTickets for help on using tickets.