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

推荐订阅源

S
Security @ Cisco Blogs
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
C
CERT Recently Published Vulnerability Notes
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cisco Blogs
博客园 - 司徒正美
L
LINUX DO - 热门话题
D
Docker
M
MIT News - Artificial intelligence
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
Jina AI
Jina AI
Last Week in AI
Last Week in AI
Security Latest
Security Latest
The Hacker News
The Hacker News
L
Lohrmann on Cybersecurity
Y
Y Combinator Blog
A
Arctic Wolf
小众软件
小众软件
T
Threat Research - Cisco Blogs
Know Your Adversary
Know Your Adversary
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
腾讯CDC
Google DeepMind News
Google DeepMind News
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 叶小钗
I
Intezer
NISL@THU
NISL@THU
A
About on SuperTechFans
爱范儿
爱范儿
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
G
Google Developers Blog
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Cyberwarzone
Cyberwarzone
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
Latest news
Latest news

博客园 - 兵

C#异常处理的方式 CryptoAPI与.NET数字签名类的交互问题 Firefox中Iframe的blur与focus事件问题 .NET中几种基本的线程同步方法 为什么说WinForm的控件只能在主线程中创建和调用 C#与Native C++互相访问 PHP5中的引用 Windows版的PDO太衰了 Framework里某些类型成员方法的一点疑惑 C#中COM操作(二)---接口查询 C#中COM操作(一)---实例化 非弹出式的模态对话框的背景遮罩 DOTNET事件拾遗 CSS开发辅助工具:Internet Explorer Developer Toolbar 另外一种高效地判断奇数和偶数的方法 如何利用客户端缓存对网站进行优化? 一个多表查询引出的问题(2) 类的成员初始化顺序 一个多表查询引出的问题(1)
发现一个FireFox的问题
· 2008-08-04 · via 博客园 - 兵

    最近做网页的时候要求一个输入框只能输入数字,发现在ff的input上挂的dragenter和dragover事件不工作,一开始以为是自己的代码写的不对,DEBUG了半天,发现这段代码在IE下是好好的,可是在FF下就是不工作.GOOGLE了一下发现网上遇到这个问题的不止我一个,http://forums.mozillazine.org/viewtopic.php?p=1252112,看了一下文章发表的时间是2005年,那个时候应该是FF2.0左右吧,现在都3.0了还是会有这个问题,貌似FF开发团队不认为这是个BUG,本来就不打算支持

 1 <form>
 2 <input id="aaa" type="text" value="12345" /> 111111111111111</form>
 3 
 4 <script language="JavaScript1.2" type="text/javascript">
 5 function resetField(id)
 6 {
 7    field = document.getElementById(id);
 8    field.value = "";
 9    // if you comment out the above line then ff will not crash.
10    x = 1;
11 }
12 
13 field = document.getElementById("aaa");
14 if (typeof field.addEventListener == "function")
15    {
16    field.addEventListener("dragover",function(){resetField('aaa');},true);   
17    alert("added DOM event");
18    }
19 
20 if (typeof field.ondragenter != "undefined")   
21    {
22    field.ondragenter = function(){resetField('aaa')};
23    alert("added IE event");
24    }
25 
26 -->
27 </script>

类似的还有剪贴板操作,这个到是因为安全的原因,一开始就没有打算支持,但是也提供了paste事件,供我们在FF的js里完全阻止粘贴操作,但是拖拽文本的话,没有这两个事件的支持的话,怎么做到在FF里面阻止拖拽操作呢