forked from askmike/gekko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use config from frontend for backtest
- Loading branch information
Showing
5 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// https://gist.github.com/Xeoncross/7663273 | ||
|
||
/** | ||
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | ||
* | ||
* @param string url | ||
* @param object callback | ||
* @param mixed data | ||
* @param null x | ||
*/ | ||
function ajax(url, callback, data, x) { | ||
try { | ||
x = new(this.XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0'); | ||
x.open(data ? 'POST' : 'GET', url, 1); | ||
x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); | ||
x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); | ||
x.onreadystatechange = function () { | ||
x.readyState > 3 && callback && callback(x.responseText, x); | ||
}; | ||
x.send(data) | ||
} catch (e) { | ||
window.console && console.log(e); | ||
} | ||
}; | ||
|
||
|
||
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest | ||
// https://gist.github.com/jed/993585 | ||
// https://gist.github.com/Fluidbyte/5082377 | ||
// https://github.com/Xeoncross/kb_javascript_framework/blob/master/kB.js#L30 | ||
// https://gist.github.com/iwek/5599777 | ||
// http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx#_id | ||
|
||
// @todo look into lengthComputable for xhr.upload browsers | ||
// http://stackoverflow.com/questions/11127654/why-is-progressevent-lengthcomputable-false | ||
// http://stackoverflow.com/questions/10956574/why-might-xmlhttprequest-progressevent-lengthcomputable-be-false | ||
// https://github.com/ForbesLindesay/ajax/blob/master/index.js |
This file contains 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
This file contains 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