惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Jina AI
Jina AI
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
H
Help Net Security
Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
L
LINUX DO - 最新话题
A
Arctic Wolf
博客园_首页
S
Securelist
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Cyberwarzone
Cyberwarzone
小众软件
小众软件
T
Threatpost
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Blog — PlanetScale
Blog — PlanetScale
N
News and Events Feed by Topic
NISL@THU
NISL@THU
Forbes - Security
Forbes - Security
博客园 - 聂微东
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
H
Heimdal Security Blog
罗磊的独立博客
S
Security @ Cisco Blogs
B
Blog
T
Troy Hunt's Blog
Engineering at Meta
Engineering at Meta
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Hacker News
The Hacker News
The Last Watchdog
The Last Watchdog
Hacker News - Newest:
Hacker News - Newest: "LLM"
I
Intezer
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
S
Schneier on Security
月光博客
月光博客
L
LINUX DO - 热门话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - Chatterley

关于分层和职责 验证码的安全效果 Sea@35还是挺适合初玩游戏的人 无题国庆 google.cn的设计? Microsoft Academic Address 注册openid来遨游网络 缓存有关的几篇文章 product@35 wordpress mu无法显示中文问题的解决方法 Zend framework 1.0.0下载 PHP扩展入门的好文章 microformats Windows SharePoint Services Skills 第17界Jolt大奖 产品开发和商业系统开发 走了,想回头,却不能回头 Ajax界面 工作流开发的一篇好文章
wpmu中使用jquery的bug
Chatterley · 2007-10-11 · via 博客园 - Chatterley

今天修改wordpressmu遇到一个关于使用Jquery的bug,在IE下,老显示js有错误。bug显示信息为:Error:expected identifier, string or number。
我于是找到了dashboardswitcher.php里的一段js:
jQuery( function($) {
var switchTime;
var w = false;
var h = $( '#blog-title' )
 .css({
  background: 'transparent url( ../wp-content/mu-plugins/bullet_arrow_down.gif ) no-repeat scroll 100% .2em;',
  padding: '0 25px 2px 5px',
  cursor: 'pointer',
  border: '1px solid #14568a',//这里多了一个","
 })
 .parent().css( { position: 'relative' }).end()
 .append( $('#switchermenu') )
 .hover( function() {
  $(this).css({ border: '1px solid #1a70b4'});
  switchTime = window.setTimeout( function() {
   $('#switchermenu').fadeIn('fast').css( 'top', h ).find('a').width( w = w ? w : $('#switchermenu').width() );
  }, 300 );
 }, function() {
  window.clearTimeout( switchTime );
  $(this).css({ border: '1px solid #14568a' }) ;
  $('#switchermenu').hide();
 })
 .height() - 3;
});

jQuery还真是强大,既然一句话就实现了,包括样式变化,以及switchermenu的显示和隐藏等功能。正为jquery震撼,难怪说jquery改变了js的编码风格。
我在这段代码中找了半天,没有看出什么问题。可能是由于太相信wpmu了,一直只在自己添加的代码里找。外加,没有太在意wpmu中的小细节。而且,它在fireFox下一切都正常。正在无奈的情况下发现了多了一个“,”,呵呵,得意……又找到一个wpmu的bug。原来FF应该可以智能补差,例如<br >它会补充</br>,而对空的变量则会忽略。而IE则没有那么智能,原本期望“,”后有个变量,则自然出现错误。
一个小小的“,”,就可以看出两个browser的智能差距,没用过IE7,不知道它是不是也变智能了。