Injecting data into jQuery $.getScript call -
i need inject data $.getscript
call, it'll availabe in ready handler, how do that?
// since it's called in loop need pass context read handler $.getscript(path, function (e2) { };
in regular event handlers can do passing data second parameter , e.data.* within event handler:
element.on("event", { extra: "data" }, function(e) { console.log(e.data.extra); });
which doesn't seem work $.getscript.
the .getscript() not provide functionality, think can make use of closure here
ex:
for(var = 0; < x; i++){ (function(idx){ $.getscript(path, function (e2) { console.log(idx); }); })(i); }
Comments
Post a Comment