Created
March 6, 2011 12:33
-
-
Save watagashi/857254 to your computer and use it in GitHub Desktop.
twicli でクロスドメイン JavaScript コールバックのデフォルトのリトライ回数を変更。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xds.retry = 1; | |
xds.load_default = function(url, callback, old, callback_key) { | |
this.abort(old); | |
return this.load(url, callback, twFail, this.retry, callback_key); | |
}; | |
xds.load_for_tab = function(url, callback, callback_key) { // タブ切替時に自動abort | |
var ifr_tab = this.ifr_tab; | |
var fr = [this.load(url, | |
function() { callback.apply(this,arguments); try { ifr_tab.remove(fr[0]); } catch(e) {} }, | |
function() { twFail(); try { ifr_tab.remove(fr[0]); } catch(e) {} }, | |
this.retry, callback_key)]; | |
this.ifr_tab.push(fr[0]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment