Skip to content

Commit 84c793a

Browse files
committed
Fixed the jsonp bug reintroduced with the previous commit. Fixed tab/space issue
1 parent 5d85632 commit 84c793a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"globals": {
3-
"ActiveXObject": false
3+
"ActiveXObject": false,
4+
"console": false
45
},
56
"browser": true,
67
"jquery": true

jquery.mockjax.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
// Create the required JSONP callback function for the request
357357
function createJsonpCallback( requestSettings, mockHandler, origSettings ) {
358358
var callbackContext = origSettings && origSettings.context || requestSettings;
359-
jsonp = requestSettings.jsonpCallback || ("jsonp" + jsc++);
359+
var jsonp = requestSettings.jsonpCallback || ("jsonp" + jsc++);
360360

361361
// Replace the =? sequence both in the query string and the data
362362
if ( requestSettings.data ) {
@@ -369,8 +369,8 @@
369369
// Handle JSONP-style loading
370370
window[ jsonp ] = window[ jsonp ] || function( tmp ) {
371371
data = tmp;
372-
jsonpSuccess( requestSettings, callbackContext, mockHandler );
373-
jsonpComplete( requestSettings, callbackContext, mockHandler );
372+
jsonpSuccess( requestSettings, callbackContext, mockHandler );
373+
jsonpComplete( requestSettings, callbackContext, mockHandler );
374374
// Garbage collect
375375
window[ jsonp ] = undefined;
376376

@@ -566,4 +566,4 @@
566566
return mockHandlers[i];
567567
}
568568
};
569-
})(self.jQuery);
569+
})(jQuery);

0 commit comments

Comments
 (0)