(url, done)
| 9336 | }; |
| 9337 | |
| 9338 | function jsonpReq(url, done) { |
| 9339 | // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.: |
| 9340 | // - fetches local scripts via XHR and evals them |
| 9341 | // - adds and immediately removes script elements from the document |
| 9342 | var script = rawDocument.createElement('script'), |
| 9343 | doneWrapper = function() { |
| 9344 | rawDocument.body.removeChild(script); |
| 9345 | if (done) done(); |
| 9346 | }; |
| 9347 | |
| 9348 | script.type = 'text/javascript'; |
| 9349 | script.src = url; |
| 9350 | |
| 9351 | if (msie) { |
| 9352 | script.onreadystatechange = function() { |
| 9353 | if (/loaded|complete/.test(script.readyState)) doneWrapper(); |
| 9354 | }; |
| 9355 | } else { |
| 9356 | script.onload = script.onerror = doneWrapper; |
| 9357 | } |
| 9358 | |
| 9359 | rawDocument.body.appendChild(script); |
| 9360 | } |
| 9361 | } |
| 9362 | |
| 9363 | /** |
no test coverage detected