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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - talantlee

C# Windows Form 下通过MethodInvoker 实现异步调用 (不使用thread) Web导出Excel时"0"自动消失的解决方案 - talantlee - 博客园 如何令web中的Select中实现Combox效果 - talantlee - 博客园 Sql Server 2005 新的分页存储过程的推荐写法 .NET 编译时出现LC.exe错误解决方法 C#中通过代码控制IIS服务重启 - talantlee - 博客园 Web所有父窗体与子窗体的交互方法列举(子调用父窗体函数) Javascrip的給人忽略掉的循環寫法(FOR IN) CSS 一些语法规范以及写法(不涉及語法) 学习.NET技術的一些网站推荐 javascript 中面向對象編程 (類的繼承) (小技巧九) 【摘錄】Xml讀寫示例~ javascript MailTo 郵件技巧(小技巧八) - talantlee SQl2000數據同步技術入門級(DTS,Replication) javascript 彈出式窗體詳解 (小技巧六) 【文摘】让你受益匪浅的IT培训语录 javascript 中面向對象編程 (類的構造) (小技巧五) - talantlee 【文摘】设计模式:Model View Presenter 《文摘》伟大架构师的秘密
javascript IE与FireFox 一些兼容写法 (小技巧七)
talantlee · 2007-04-26 · via 博客园 - talantlee

1>获取控件用document.getElementById,不用document.all(FF等浏览器不支持)
2><button> 会被firefox解释为提交form或者刷新页面,需要写标准<button type="button">
3>使用childNode()代替之前的children 
4> 手型鼠标指针请用cursor:pointer,不用 cursor:hand
5>获取自己定义的属性 用  document.getElementByID("TD1").getAttribute("isOBJ")  代替document.getElementByID("TD1").isOBJ
6>事件追加方法attachEvent(IE)/detachEvent;addEventListener( Mozilla, Netscape, Firefox)/removeEventListener
  又或者直接用obj.onmouseover=func;
7>Firefox中不存在 Event时间,必须通过object本身去取
   在Firefox获取当前物件的坐标方法:
  document.onmousemove = Inti_move;
  function  Inti_move(ert)
{
  x=ert.pageX;
}

表4 Mozilla与IE之间的事件属性差异 altKey altKey Boolean property that returns whether the alt key was pressed during the event. cancelBubble stopPropagation() Used to stop the event from bubbling farther up the tree. clientX clientX The X coordinate of the event, in relation to the element viewport. clientY clientY The Y coordinate of the event, in relation to the element viewport. ctrlKey ctrlKey Boolean property that returns whether the Ctrl key was pressed during the event. fromElement relatedTarget For mouse events, this is the element from which the mouse moved away. keyCode keyCode For keyboard events, this is a number representing the key that was pressed. It is 0 for mouse events. returnValue preventDefault() Used to prevent the event's default action from occurring. screenX screenX The X coordinate of the event, in relation to the screen. screenY screenY The Y coordinate of the event, in relation to the screen. shiftKey shiftKey Boolean property that returns whether the Shift key was pressed during the event. srcElement target The element to which the event was originally dispatched. toElement currentTarget For mouse events, this is the element to which the mouse moved. type type Returns the name of the event.
Internet Explorer Name Mozilla Name Description

8>event.keyCode的問題解決
在FF中不存在window.event.keyCode屬性。可以用以下方法解決

function keepKeyNum(evt)
{
        
var  k=window.event?evt.keyCode:evt.which;
        
if ((k<=57&& (k>=48))
                
{return true;}
        
else 
                
{return false;}
}

 <input type="text" onKeyPress=" return keepKeyNum(event);" >