added support for dynamic callback generation for jsonp
This commit is contained in:
parent
77816238e5
commit
42f041a02e
@ -50,6 +50,10 @@
|
||||
return exports.torque.extend({}, a);
|
||||
}
|
||||
|
||||
exports.torque.isFunction = function(f) {
|
||||
return typeof f == 'function' || false;
|
||||
}
|
||||
|
||||
exports.torque.isArray = function(value) {
|
||||
return value && typeof value == 'object' && Object.prototype.toString.call(value) == '[object Array]';
|
||||
};
|
||||
@ -65,4 +69,8 @@
|
||||
return !!document.createElement('canvas');
|
||||
};
|
||||
|
||||
exports.torque.flags = {
|
||||
sprites_to_images: navigator.userAgent.indexOf('Safari') === -1
|
||||
}
|
||||
|
||||
})(typeof exports === "undefined" ? this : exports);
|
||||
|
@ -13,6 +13,10 @@
|
||||
// function name
|
||||
var fnName = options.callbackName || 'torque_' + Date.now();
|
||||
|
||||
if (torque.isFunction(fnName)) {
|
||||
fnName = fnName();
|
||||
}
|
||||
|
||||
function clean() {
|
||||
head.removeChild(script);
|
||||
clearTimeout(timeoutTimer);
|
||||
|
Loading…
Reference in New Issue
Block a user