#11608 closed bug (invalid)
Trim Function Not Working in IE
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The trim function does not work correctly in IE 9.0.8112.16421. Please look in to this, there is nothing complicated. Just run the following code:
var myVar = 'AB012'; alert(myVar); myVar.trim(); code breaks here in IE alert(myVar);
Change History (7)
comment:1 follow-up: 3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 Changed 11 years ago by
Replying to dmethvin:
jQuery doesn't pollute the
String
object with a.trim()
method. Please ask for help on a forum.
My code works fine in the following browsers: firefox, chrome, opera and safari. But breaks on the line that has myVar.trim() in internet explorer. Please explain to me how that is not a problem with the '.trim()' method?
comment:4 Changed 11 years ago by
We don't add a .trim()
method to the String
object. If you think you have found a bug in the IE9 String
object, please file a bug with Microsoft. Or, ask for help on a forum.
comment:5 follow-up: 6 Changed 11 years ago by
Because <String>.trim()
has nothing to do with jQuery.
$.trim(<String>)
does, and it works awesomely in all browsers.
comment:6 follow-up: 7 Changed 11 years ago by
Replying to mikesherov:
Because
<String>.trim()
has nothing to do with jQuery.
$.trim(<String>)
does, and it works awesomely in all browsers.
OK. Thank you guys. I will report to microsoft about the string. I find it interesting that the other browsers worked fine on this but explorer gave me problems. mikesherov thank you for the explaining, I changed my code & explorer is working nicely.
comment:7 Changed 11 years ago by
Replying to anonymous:
Replying to mikesherov:
Because
<String>.trim()
has nothing to do with jQuery.
$.trim(<String>)
does, and it works awesomely in all browsers.OK. Thank you guys. I will report to microsoft about the string. I find it interesting that the other browsers worked fine on this but explorer gave me problems. mikesherov thank you for the explaining, I changed my code & explorer is working nicely.
There is nothing surprising about this - IE has historically been broken, missing features and implementations.
jQuery doesn't pollute the
String
object with a.trim()
method. Please ask for help on a forum.