Skip to content

Commit 5dcf751

Browse files
committed
Merge pull request #1 from chrisbarr/master
Added the 'this' keyword
2 parents 0481007 + 5a991c2 commit 5dcf751

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jsonp.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ var JSONp = {
2626

2727
// Generate call ID
2828
var d = new Date();
29-
JSONp.callbackCount++;
30-
params.cbID = 'cb' + d.getTime() + '_' + JSONp.callbackCount;
29+
this.callbackCount++;
30+
params.cbID = 'cb' + d.getTime() + '_' + this.callbackCount;
3131

3232
// Assign callback function
33-
JSONp.callbacks[params.cbID] = function(json){
33+
this.callbacks[params.cbID] = function(json){
3434
params.success(json);
3535

3636
// Cleanup script tags
@@ -41,7 +41,7 @@ var JSONp = {
4141

4242
// Create script tag
4343
var el = document.createElement('script');
44-
el.src = params.url + '?' + JSONp.buildQueryString(params);
44+
el.src = params.url + '?' + this.buildQueryString(params);
4545
el.id = params.cbID;
4646

4747
// Write into head tags

0 commit comments

Comments
 (0)