Reputation: 3
I am using jqgrid and jquery validate plugin on same page but when I include validate plugin jqgrid is unable to load json data. When I remove the validate plugin it starts working perfectly. I get the follwing error.
Invalid label Line: 0, Column: 1 Source Code: {"page":"1"
Upvotes: 0
Views: 826
Reputation: 221997
I could reproduce your problem with jQuery Validate 1.7. I could suggest very easy workaround: to comment the following lines of jQuery.Validate.js:
// ajax mode: abort
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
;(function($) {
var ajax = $.ajax;
var pendingRequests = {};
$.ajax = function(settings) {
// create settings for compatibility with ajaxSetup
settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings));
var port = settings.port;
if (settings.mode == "abort") {
if ( pendingRequests[port] ) {
pendingRequests[port].abort();
}
return (pendingRequests[port] = ajax.apply(this, arguments));
}
return ajax.apply(this, arguments);
};
})(jQuery);
If you use the last version 1.8 of jQuery.Validate (you can download it here) no problem seems exist.
Upvotes: 1