#14063 closed enhancement (fixed)
dojo.io.script support delayed callbacks or throw error
Reported by: | hurrymaplelad | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | IO | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Full example loading google maps here: http://stackoverflow.com/questions/7438854/loading-google-maps-api-v3-asynchronously-with-dojo-io-script-fails-silently
JSFiddle Example: http://jsfiddle.net/sKNmS/
It appears that dojo.io.script.get()
expects the immediately returned script to call the JSONP callback. In the google maps example, the loaded script does some additional work (loads more files) before calling the global callback. By then, dojo.io.script has removed its global callback, and neither the load
nor the error
callback is invoked.
Ideally dojo.io.script will support the google maps delayed callback. If that's deemed outside io.script's scope, at least call the error
callback and let me know that the loaded script didn't call the expected jsonp callback.
Change History (4)
comment:1 Changed 9 years ago by
Owner: | changed from James Burke to Bryan Forbes |
---|
comment:2 Changed 8 years ago by
I think this one can be closed. This seems to work properly in 1.8.0:
// Script is required from 'dojo/request/script' Script.get( '//maps.google.com/maps/api/js?v=3&sensor=false', { jsonp:'callback' } ).then( function (data) { window.console.log(window.google); }, function (err) { window.console.log('Whoops' + err); } );
comment:3 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Since it has been reported as fixed, I'm marking as such.
comment:4 Changed 7 years ago by
Milestone: | tbd → 1.8 |
---|
Bulk change to reassign IO tickets to Bryan, since he is working on new dojo/request module. Some of these tickets should probably be closed as already fixed, invalid, or wontfix.