JAVA
with Friends
Tuesday, June 28, 2011
JavaScript trim() function not working in FF or IE
Copy the code given below in your java script tag and get the trim() function working
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment