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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
L
LINUX DO - 最新话题
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
PCI Perspectives
PCI Perspectives
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
TaoSecurity Blog
TaoSecurity Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Attack and Defense Labs
Attack and Defense Labs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
小众软件
小众软件
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
F
Fortinet All Blogs
T
Threatpost
Security Latest
Security Latest
V
Vulnerabilities – Threatpost
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
Forbes - Security
Forbes - Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
CERT Recently Published Vulnerability Notes
AI
AI
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Schneier on Security
I
Intezer
The GitHub Blog
The GitHub Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
V2EX
aimingoo的专栏
aimingoo的专栏
量子位
NISL@THU
NISL@THU
N
News and Events Feed by Topic
O
OpenAI News
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
Schneier on Security
Schneier on Security
S
Secure Thoughts
The Cloudflare Blog
J
Java Code Geeks

博客园 - 兵

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里面阻止拖拽操作呢