摘要:
var PureObject = Object; Object = function(){ } Object.prototype = PureObject.prototype; //或 //Object.prototype = {}.constructor.prototype; Object.prototype.hello = function(){ alert("Hello!!"); } function MyObject(){} var obj = {name:34}; obj.hello(); 阅读全文
摘要:
//生成JSON对象 var obj = eval("[{a:32,b:32}][0]"); //或 obj = eval("({a:32,b:32})"); //alert(obj.a); //生成匿名function var func = eval("(function (){ alert('evalFunc')}).prototype.constructor"); //或 func = eval("[function (){ alert('evalFunc')}][0]"); 阅读全文