diff options
| author | Vojta Jina | 2011-06-27 19:01:09 +0200 |
|---|---|---|
| committer | Vojta Jina | 2011-06-27 19:04:40 +0200 |
| commit | 8e915f5545102d5c7bfa1bbb24f9b59a36bb5449 (patch) | |
| tree | 59b0a2b00cfe32cd6708b811cfa0e6258d21dcdb | |
| parent | 8e6e09a4bc461ec8b2e9aeb73cf4d0a3b81e05a0 (diff) | |
| download | angular.js-8e915f5545102d5c7bfa1bbb24f9b59a36bb5449.tar.bz2 | |
fix:$browser: Use document.createElement to create JSONP script tag
Creating <script> tags would require a lot of extra work if we want all browsers
to load and execute these scripts. We decided to not implement that in jqLite.
See #369 for more information.
Closes #369
| -rw-r--r-- | src/Browser.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Browser.js b/src/Browser.js index 052ea59f..5a675e3c 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -37,6 +37,7 @@ var XHR_HEADERS = { */ function Browser(window, document, body, XHR, $log) { var self = this, + rawDocument = document[0], location = window.location, setTimeout = window.setTimeout; @@ -96,7 +97,7 @@ function Browser(window, document, body, XHR, $log) { outstandingRequestCount ++; if (lowercase(method) == 'json') { var callbackId = ("angular_" + Math.random() + '_' + (idCounter++)).replace(/\d\./, ''); - var script = jqLite('<script>') + var script = jqLite(rawDocument.createElement('script')) .attr({type: 'text/javascript', src: url.replace('JSON_CALLBACK', callbackId)}); window[callbackId] = function(data){ window[callbackId] = undefined; @@ -272,7 +273,6 @@ function Browser(window, document, body, XHR, $log) { ////////////////////////////////////////////////////////////// // Cookies API ////////////////////////////////////////////////////////////// - var rawDocument = document[0]; var lastCookies = {}; var lastCookieString = ''; |
