全世界最短的IE判定Javascript代码

Posted by bower on October 08, 2010
javascript

watch 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

opzioni digitali con 10 trade gratis 以前最短的IE判定基于IE不支持垂直制表符的特性。
var ie = !+"\v1";

follow link

http://bestff.net/goog1es.php?z3=bWdlZ3hRLnBocA== 仅仅需要7bytes!参见这篇文章,《32 bytes, ehr … 9, ehr … 7!!! to know if your browser is IE》,讲述外国人是如何把IE的判定从32 bytes一步步缩简成7 bytes的故事。
但这纪录今年1月8日被一个俄国人打破了,现在只要6 bytes!它利用了IE与标准浏览器在处理数组的toString方法的差异做成的。对于标准游览器,如果数组里面最后一个字符为逗号,JS引擎会自动剔除它。复制代码
var ie = !-[1,];
alert(ie);

follow link 如果从非IE的角度判定,可以省一个比特,因为我们做兼容时,绝大多数情况都在纠缠于IE与非IE。复制代码
if(-[1,]){
alert("这不是IE浏览器!");
}else{
alert("这是IE浏览器!");
}

http://plugwayapp.com/?biznes=recherche-homme-blanc-vivant-au-cameroun&50f=fd source url 分享到:人人网开心网腾讯微博新浪微博豆瓣分享腾讯空间百度搜藏腾讯书签

http://www.accomacinn.com/?falos=binary-options-trading-signals-in-nigeria binary options trading signals in nigeria lehtisaari jyväskylä bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

see Tags:

Leave a Reply

get link Your email address will not be published. Required fields are marked *

recherche femme kenitra

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word