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

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
D
Docker
D
DataBreaches.Net
V
Vulnerabilities – Threatpost
P
Palo Alto Networks Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
L
LINUX DO - 热门话题
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
Project Zero
Project Zero
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
宝玉的分享
宝玉的分享
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Securelist
Cisco Talos Blog
Cisco Talos Blog
Google DeepMind News
Google DeepMind News
Scott Helme
Scott Helme
The Cloudflare Blog
Know Your Adversary
Know Your Adversary
T
Tor Project blog
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
阮一峰的网络日志
阮一峰的网络日志
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
AWS News Blog
AWS News Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
T
Troy Hunt's Blog
量子位
G
GRAHAM CLULEY
O
OpenAI News
Engineering at Meta
Engineering at Meta
博客园 - Franky
SecWiki News
SecWiki News
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - 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 中面向對象編程 (類的構造) (小技巧五) 【文摘】设计模式: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之间的事件属性差异
Internet Explorer Name Mozilla Name Description
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.

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);" >