Browse files

Tiny performance improvement in Request.JSONP

  • Loading branch information...
1 parent d6796c7 commit 6a1d0c5f12d4e438aded42cd0a3ce3011cdfae56 @arian arian committed Apr 1, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 Source/Request/Request.JSONP.js
View
8 Source/Request/Request.JSONP.js
@@ -28,8 +28,7 @@ Request.JSONP = new Class({
Implements: [Chain, Events, Options],
- options: {
- /*
+ options: {/*
onRequest: function(src, scriptElement){},
onComplete: function(data){},
onSuccess: function(data){},
@@ -96,15 +95,16 @@ Request.JSONP = new Class({
},
getScript: function(src){
- if (!this.script) this.script = new Element('script[type=text/javascript]', {
+ if (!this.script) this.script = new Element('script', {
+ type: 'text/javascript',
async: true,
src: src
});
return this.script;
},
success: function(args, index){
- if (!this.running) return false;
+ if (!this.running) return;
this.clear()
.fireEvent('complete', args).fireEvent('success', args)
.callChain();

0 comments on commit 6a1d0c5

Please sign in to comment.