MCPcopy Create free account
hub / github.com/JsAaron/jQuery / getScriptData

Function getScriptData

迷你jQuery/basis/Require.js:1195–1209  ·  view source on GitHub ↗

* Given an event from a script node, get the requirejs info from it, * and then removes the event listeners on the node. * @param {Event} evt * @returns {Object}

(evt)

Source from the content-addressed store, hash-verified

1193 * @returns {Object}
1194 */
1195 function getScriptData(evt) {
1196 //Using currentTarget instead of target for Firefox 2.0's sake. Not
1197 //all old browsers will be supported, but this one was easy enough
1198 //to support and still makes sense.
1199 var node = evt.currentTarget || evt.srcElement;
1200
1201 //Remove the listeners once here.
1202 removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
1203 removeListener(node, context.onScriptError, 'error');
1204
1205 return {
1206 node: node,
1207 id: node && node.getAttribute('data-requiremodule')
1208 };
1209 }
1210
1211 function intakeDefines() {
1212 var args;

Callers 1

newContextFunction · 0.85

Calls 1

removeListenerFunction · 0.85

Tested by

no test coverage detected