Internet Explorer 7 jQuery Validate
can someone please suggest a better means to accomplish what i'm doing below. The commented out return works in all browsers besides after IE7. I know this is totally ghetto, but this is the only way I've gotten it to work because IE7 can't parse json that I know of. It seems like this is just one thing piling up on top of the other when I use webforms and jquery Validation. I can't get my webservice to reply if the values are in the query string so I have to add rules manually. i.e. /webservices/ipmws.asmx/SiteValid?tbSiteName=WHATEVER.... If that would work perhaps all this wouldn't be required?
Thanks in advance.
$('#form2').validate();
$("#tbSiteName").rules("add", {
remote: function () {
var r = {
url: "/webservices/ipmws.asmx/SiteValid",
type: "POST",
data: "{'tbSiteName': '" + $("#tbSiteName").val() + "'}",
dataType: "json",
contentType: "application/json;开发者_C百科 charset=utf-8",
dataFilter: function (data) {
var str = data.split(':');
return str[1].substring(0, str[1].length -1)
//return (JSON.parse(data)).d;
}
}
return r;
},
messages: {
remote: "The site code is either not present or invalid."
}
});
Have you tried jQuery's $.parseJSON() method? http://api.jquery.com/jQuery.parseJSON/
精彩评论