注册
登录

您现在的位置是:首页 > 学无止境

JS界的tiny detecting

木木彡82 2010-04-07 16:20:00 364人围观
ie = /v==v;ie = !!top.execScript;ie = /*@cc_on!@*/!1;ie8 = !!window.XDomainRequest;IEVersion = 0/*@cc_on+ScriptEngineMajorVersion()@*/;ff = /a/[-1]==...
ie = '/v'=='v';
ie = !!top.execScript;
ie = /*@cc_on!@*/!1;
ie8 = !!window.XDomainRequest;
IEVersion = 0/*@cc_on+ScriptEngineMajorVersion()@*/;
ff = /a/[-1]=='a';
ff3 = (function x(){})[-5]=='x';
ff2 = (function x(){})[-6]=='x';
safari=/a/.__proto__=='//';
chrome=/source/.test((/a/.toString+''));
opera=/^function (/.test([].sort);

上面的代码很神奇,更重要的是:It works!

文章评论

  • 登录后评论

点击排行