Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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: Changed 4 years ago by dmethvin

  • Resolution set to invalid
  • Status changed from new to closed

jQuery doesn't pollute the String object with a .trim() method. Please ask for help on a forum.

comment:2 Changed 4 years ago by dmethvin

#11609 is a duplicate of this ticket.

comment:3 in reply to: ↑ 1 Changed 4 years ago by anonymous

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 4 years ago by dmethvin

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: Changed 4 years ago by mikesherov

Because <String>.trim() has nothing to do with jQuery.

$.trim(<String>) does, and it works awesomely in all browsers.

comment:6 in reply to: ↑ 5 ; follow-up: Changed 4 years ago by 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.

comment:7 in reply to: ↑ 6 Changed 4 years ago by rwaldron

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.

Note: See TracTickets for help on using tickets.