Closed dvv closed 13 years ago
is this JSONP or regular style AJAX?
Neither. I meant vanilla inclusion of scripts, just as the first example in readme's "Exhaustive list of ways to use $script.js" section.
$.script literally just fetches files, it does not return data back in a callback. so i'm guessing you're looking for something like JSONP? Or no?
I believe he's talking about something closer to what loadrunner or requirejs does... However this requires you add code to the files you're calling.
Ah. Right you are. There's no means at all, i guess, to catch what's returned from <script src="foo.js"></script>
.
One has to augment window
to get this result.
Still wonder how they cope with that in RequireJS: require([deps], function(return-of-dep0-if-any, return-of-dep2-if-any,...){...})
?
@fat: you answered while I was hitting the keyboard :) @ded, @fat: Thanks, closing...
if you are indeed looking for some cool exporting requiring libs, i'd urge you to check out one of our favorites (as @fat mentioned) called LoadRunner. It has a nice exporting feature of an async nature.
provide('foo', function (exports) {
// do shit...
exports(stuffs);
});
// other file
using('foo', function (stuffs) {
// do stuff with stuffs...
});
Hi!
Is there a way to get the result of loaded script execution into the callback? Say,
$.script('foo', function(foo){ .., live foo here ... })
. W/o this feature one has to spoil the global namespace, i presume.TIA, --Vladimir