mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-27 03:30:24 +00:00
fix issue where script calls back before callback registered.
This commit is contained in:
parent
c5cfe2b393
commit
286d1fe434
1 changed files with 1 additions and 1 deletions
|
|
@ -30,11 +30,11 @@ function Browser(location, document, head, XHR, $log) {
|
|||
var script = document[0].createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = url.replace('JSON_CALLBACK', callbackId);
|
||||
head.append(script);
|
||||
window[callbackId] = function(data){
|
||||
window[callbackId] = _undefined;
|
||||
callback(200, data);
|
||||
};
|
||||
head.append(script);
|
||||
} else {
|
||||
var xhr = new XHR();
|
||||
xhr.open(method, url, true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue