String.prototype.ref = function () {
for (var args = [], i = 0; i < arguments.length; i++)
args.push('arguments[' + i + ']');
if (window[this] && window[this] instanceof Function)
return eval('(new window.' + this + '(' + args.join(',') + '))');
throw new Error('Function window.' + this + ' does not exist.');
};
ref
Category: Uncategorized |
Tags: js
Leave a Reply
You must be logged in to post a comment.