Tuesday, February 21, 2012

Trimming issue in IE 8 .trim(). JQuery


Trimming issue in IE 8 .trim().

Using .trim() to trim the value of the text does not works properly in I.E 8


For example

   var productName =$("#hdnProdName").val().trim();
 
for the above code we get an error message


"Message: Object doesn't support this property or method"


Solution for this Issue is.

 Use

   var productName = $.trim($("#hdnProdName").val());



This works in all browsers well.

No comments:

Post a Comment