[ת]javascriptÅжÏä¯ÀÀÆ÷ÀàÐÍÓë°æ±¾
ÒªÏëд³ö¿çä¯ÀÀÆ÷µÄjavascript£¬¾Í±ØÐ붮µÃÐá̽¼¼Êõ¡£ÕâÊÇä¯ÀÀÆ÷´óÕ½ÒÅÁôϵĴóµØÀ×£¬ÊÂÒÑÈç´Ë£¬Ö»ºÃÈÏÃü£¬¹Ô¹Ôд·ÖÖ§½á¹¹°É£¬º¯Êý¾ÍÊÇÕâÑù²»Öª²»¾õÖб䳤µÄ¡£
ÏÈ¿´µ¥Ò»ä¯ÀÀÆ÷µÄÅжϣ¬ÎÒÃÇûÓбØÐëÈ¥ÕÒnavigator.userAgentµÄÂé·³£¬ÎÒÔÚ¹úÍâµÄ²©¿ÍÍøÕ¾ÊÕ¼¯ÁËÈçÏÂhack£¬¶ÌС¾«º·£º
ie = !+"\v1" ;
ie ='\v'=='v' ;
ie = 0//@cc_on+1;
ie = !!top.execScript;
ie = /*@cc_on!@*/!1;
ie8 = !!window.XDomainRequest;
//ÎÒ×Ô´´µÄ£¬Èç¹ûÊÇIE£¬»á·µ»Ø6,7,8´ú±íie6,ie7,ie8£¬·ñÔò·µ»Ø1
IEVersion = (" " + (/*@cc_on @_jscript_version @*/-1)).slice(-1)
//»ùÓÚÌõ¼þ±àÒëµÄÐá̽½Å±¾£¬»¹ÓÐÈçϼ¸¸ö£º
IE8=@cc_on @_jscript_version == 5.8 ? true : @false
IE7=@cc_on @_jscript_version == 5.7 ? true : @false
IE6=@cc_on @_jscript_version == 5.6 ? true : @false
IE55=@cc_on @_jscript_version == 5.5 ? true : @false
ff = /a/[-1]=='a';
ff3 = (function x(){})[-5]=='x';
ff2 = (function x(){})[-6]=='x';
safari=/a/.__proto__=='//';
safari = window.openDatabase;
chrome=/source/.test((/a/.toString+''));
opera=!!window.opera ;
opera=/^function (/.test([].sort);
»¹ÓÐÅжÏmaxthonµÄ£º
//³ö´¦£ºhttp://www.cnblogs.com/xiarugu/archive/2009/02/02/1382293.html
function IsMaxthon()
{
try{
window.external.max_invoke("GetHotKey");
return true;
}catch(ex){
return false;
}
}
alert(IsMaxthon());
//³ö´¦£ºhttp://bbs.maxthon.cn/archiver/?tid-148353.html
try{
if(external.max_version.indexOf("1.")==0){
var isMaxthon1 = 1;
}else{
var isMaxthon1 = 0;
}
}catch(e){
&
Ïà¹ØÎĵµ£º
ʹÓÃtry{...}catch(){} ·½Ê½£¬Àý×ÓÈçÏ£º
function showAlarm(strObject){
try{
svgElement = document.getElementById(strObject);
svgElement.setAttribute("visibility","visible");
setTimeout("hideAlarm()",3000);//3Ãëºó½áÊø±¨¾¯
}catch(ex){
alert("º¯ÊýshowAlarm()·¢ÉúÒì³££º"+ex.descrip ......
YUI Compressor ѹËõ JavaScript µÄÄÚÈÝ°üÀ¨£º
ÒƳý×¢ÊÍ
ÒƳý¶îÍâµÄ¿Õ¸ñ
ϸ΢ÓÅ»¯
±êʶ·ûÌæ»»£¨Identifier Replacement£©
YUI Compressor °üÀ¨ÄÄЩϸ΢ÓÅ»¯ÄØ£¿
object["property"] £¬Èç¹ûÊôÐÔÃûÊǺϷ¨µÄ JavaScript ±êʶ·û£¨×¢£ººÏ·¨µÄ JavaScript ±êʶ·û——ÓÉÒ»¸ö×Öĸ¿ªÍ·£¬ÆäºóÑ¡ÔñÐԵؼÓÉÏÒ»¸ö»òÕ ......
var sDate = new Date(Date.UTC(arys[0], arys[1] - 1, arys[2]));
var eDate = new Date(Date.UTC(arys1[0], arys1[1] - 1, arys1[2]));
......
¡¡½éÉÜÔõÑù½â¾öJavaScriptÒ³ÃæË¢ÐÂÓ뵯³ö´°¿ÚµÄÎÊÌâ¡£
¡¡¡¡1.ÎÞÌáʾˢÐÂÍøÒ³
¡¡¡¡´ó¼ÒÓÐûÓз¢ÏÖ£¬ÓÐЩÍøÒ³£¬Ë¢ÐµÄʱºò£¬»áµ¯³öÒ»¸öÌáʾ´°¿Ú£¬µã“È·¶¨”²Å»áˢС£
¡¡¡¡¶øÓеÄÒ³Ãæ²»»áÌáʾ£¬²»µ¯³öÌáʾ´°¿Ú£¬Ö±½Ó¾ÍË¢ÐÂÁË.
¡¡¡¡Èç¹ûÒ³ÃæûÓÐform£¬Ôò²»»áµ¯³öÌáʾ´°¿Ú¡£Èç¹ûÒ³ÃæÓÐform±íµ¥£¬
¡¡¡¡a)< fo ......