Side navigation
#8938 closed bug (invalid)
Opened April 21, 2011 06:40PM UTC
Closed April 21, 2011 08:01PM UTC
Error with .text and IE
Reported by: | marc.c.johnson@gmail.com | 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;
});
Attachments (0)
Change History (1)
Changed April 21, 2011 08:01PM UTC by comment:1
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
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