Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trim() function for old IE #23

Open
blowsie opened this issue May 28, 2013 · 0 comments
Open

Add trim() function for old IE #23

blowsie opened this issue May 28, 2013 · 0 comments

Comments

@blowsie
Copy link

blowsie commented May 28, 2013

Most of the examples fall over in old because the .trim() function doesn't exist.

It may be worth including the following fix in within the library.

if(typeof String.prototype.trim !== 'function') {
   String.prototype.trim = function() {
     return this.replace(/^\s+|\s+$/g, ''); 
   }
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant