Solution for fixing trim() function in javascript not working in IE

Solution for fixing trim() function in javascript not working in IE

I tired to apply trim() function in Javascript for one of my code. Its working fine under mozilla.
But error display once I tried in IE7.

I have tried like this, str=str.trim()

I searched this on net and came to know that only one line code to resolve this.

Now i used like this,

relplacestr=str.replace(/^\s+/,”).replace(/\s+$/,”);

you can refer this link for detailed discussion http://qualitypointtech.net/forum/viewtopic.php?f=15&t=193

Posted in Javascript