Bug Tracker

Modify

Ticket #8938 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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

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

comment:1 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to manipulation

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.