Skip to content
Permalink
Browse files
Fix for bug #1638, where a non-string data could break an Ajax request.
  • Loading branch information
jeresig committed Oct 18, 2007
1 parent 14b88f6 commit 80a26a3
Showing 1 changed file with 2 additions and 2 deletions.
@@ -174,12 +174,12 @@ jQuery.extend({
}

// Build temporary JSONP function
if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
if ( s.dataType == "json" && (s.data && jsre.test( s.data ) || s.url.match(jsre)) ) {
jsonp = "jsonp" + jsc++;

// Replace the =? sequence both in the query string and the data
if ( s.data )
s.data = s.data.replace(jsre, "=" + jsonp);
s.data = (s.data + "").replace(jsre, "=" + jsonp);
s.url = s.url.replace(jsre, "=" + jsonp);

// We need to make sure

0 comments on commit 80a26a3

Please sign in to comment.