( FEED rss2.0 )

sed /sshd/p -n /var/log/auth.log > /log/sshd.log » 21 days ago

万恶的IE今天让我领教了它的BT,因为一个js类需要实现在html的一个area中写入一个onmouseover和onmouseout事件,但当我用js实现时用setattribute(”onmouseover”,”dosomething();”)写入,执行后在firefox下可以看到已经生成相应的html,但是当打开ie测试时却晕了,这么简单的一个属性设置语句居然在ie下不执行.

好吧,可能我确实哪儿没写对,或者area的z-index属性没设对,重新对页面中的几个area的z-index重新查了一遍,没有问题,还是从onmouseover这个事件本身开始查问题,把事件写入html不用js来生成,IE和FF下都可执行,说明onmouseover事件本身没有问题,再用js生成相应html,对比手写与js生成的代码一模一样,可问题就是js生成的事件不执行,而手写的却没有这样的问题.抓狂~~~~

在FF下js代码执行过程firebug没有报任何错误,setattribute本身也是正确的.于是钻入这个圈子反反复复抓狂了N遍.
崩溃的边缘,将代码丢给甜甜同学,让丫查查看,出去抽了根烟回来一看,丫的居然用.onmouseover=function(){dosomething();}给实现了.faint~~~对于setAttribute我有五千万个干~~~

加班完回家还不甘心,上网一查,居然还真有人遇到过有关setattribute的问题:
setAttribute does not work when used with the style attribute(2005年就报出来的bug,setattribute不干活)
伟大的IE又一个令人发指的bug(ie用setattribute写mailto时会自作聪明地重写地址)

好吧,无语了,睡觉…

RSS feed for comments on this post. TrackBack URL

One Comments » Leave a comment

  1. Comment by xyz03/22/2008 @ 9:18 am

    Many more attributes fail in IE, here is a complete list, with workarounds!

    http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Popular Tags

Monthly Archives

iHao Friends

Site Meta