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

推荐订阅源

WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 热门话题
T
Threat Research - Cisco Blogs
T
Tenable Blog
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
AI
AI
P
Proofpoint News Feed
A
About on SuperTechFans
P
Privacy International News Feed
月光博客
月光博客
雷峰网
雷峰网
S
Secure Thoughts
博客园 - 叶小钗
博客园 - 聂微东
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Project Zero
Project Zero
The Cloudflare Blog
SecWiki News
SecWiki News
The Hacker News
The Hacker News
V
Vulnerabilities – Threatpost
罗磊的独立博客
A
Arctic Wolf
阮一峰的网络日志
阮一峰的网络日志
Know Your Adversary
Know Your Adversary
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Troy Hunt's Blog
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
小众软件
小众软件
有赞技术团队
有赞技术团队
博客园 - 司徒正美
T
Tailwind CSS Blog
量子位
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Security @ Cisco Blogs
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
L
Lohrmann on Cybersecurity

博客园 - 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,不知道它是不是也变智能了。