Bug Tracker

Opened 9 years ago

Closed 9 years ago

#8938 closed bug (invalid)

Error with .text and IE

Reported by: marc.c.johnson@… Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

This bug appears to occur in all versions of jquery including 1.5.2. It's easily overcome by using other methods but it's there nonetheless and since .text is supposed to work universally xml .html, etc... I thought this was relevant.

This works in all other browsers but not IE 7, 8, or 9, so even if it is due to misuse, it seems as if it should work.

$('a#showHideForm').click(function() {

$('#mmForm').slideToggle(500); if(this.text == 'Show Form') {THIS FAILS .text isn't defined in IE instead it's .textcontent but shouldn't .text be a wrapper for whatever the browser thinks it's innerHTML should be defined?

$(this).text('Hide Form') $.get('some ajax to set a param on the backend')

} else {

$(this).text('Show Form') $.get('some other ajax set a param on the backend')

} return false;

});

Change History (1)

comment:1 Changed 9 years ago by timmywil

Component: unfiledmanipulation
Priority: undecidedlow
Resolution: invalid
Status: newclosed

The property differences are part of what jQuery handles with the .text() method. It is best to avoid changing native prototypes. See http://api.jquery.com/text

Note: See TracTickets for help on using tickets.