I am using jQuery and I have a sample jQuery code.
JQuery code:
$.ajax({
type: "POST",
url: "Login.aspx",
data: str,
success: function(result)
{
$('#loginButton').show();
$('#ajaxloading').hide();
var resLength = (result).val().trim().length;
alert(resLength);
if(resLength!=0)
{
var arr = result.split(",");
var fname = arr[0];
var lname = arr[1];
var activeCardNo = arr[2];
var multipleTier = arr[3];
var activeStatus = arr[4];
var access = arr[5];
}
}
});
In the above code example, when I try to use .val () in the line below
var resLength = (result).val().trim().length;
it gives the error "result.val is not a function" . If I use only result.trim (). length , it works fine in firefox, however giving an error in IE.
Please suggest!
source
share