检测浏览器是否为IE的最简单的方法
!-[1,]
以下是测试代码:
<html>
<head>
<script>
var isIE = !-[1,];
alert("isIE:"+isIE);
</script>
</head>
<body>
</body>
</html>太强了!
<html>
<head>
<script>
var isIE = !-[1,];
alert("isIE:"+isIE);
</script>
</head>
<body>
</body>
</html>《Dom Scripting》读书笔记 Canca 最近看了一本《Jeremy Keith: DOM Scripting, Web design with JavaScript and the DOM. Apr…
调用email的方法 //<a href="mailto:talantlee@126.com">Email</a>window.location.href="mailto:talantlee@126.com";myform.action="mailto:talant…
1>window.prompt(text, value) 簡單的基與模態窗體的對話框,(返回你輸入) var v=window.prompt("提示","請輸入你的名字")2>window.confirm(text,mess) 模態確認框(返回"是/否…
本来一个写好了的脚本在IE下正常,可是在mozilla firefox中我们发现程序报类似如下的错误: event is not defined obj has no properties 原因是Firefox中使用了不同的事件对象模型,不同于IE Dom,用的是W3C Dom. 下是我在网上找到的…
为网页添加快捷键即为网页添加onkeydown事件。 FireFox里获取键入键的ASCII码与IE获取是有些差别的。因为FF里没有Event对象。 但FF里事件触发方法中默认传送其事件对象。 即我们在JS里写该事件方法时,要多加一个参数。 例: <sc...…
<html> <head> <script language="javascript">function copy_clip(copyObjectName…