AttachEvent
来源:互联网 发布:linux执行sql命令 编辑:程序博客网 时间:2024/05/01 04:52
<table>
<tr>
<td><div id="div1">111111111</div>
</td>
</tr>
</table>
<script language="javascript">
function AttacheEvent(obj, eventType, functionName)
{
functionName = eval(functionName);
if(window.attachEvent)
{
if(typeof(functionName) == "function")
{
var fn = (function() {functionName.apply(null, Array(obj, event));});
return obj.attachEvent(eventType, fn);
}
}
else
{
obj.setAttribute(eventType, "ShowMessage(this, event)");
}
}
function ShowMessage()
{
var src = arguments[0];
var e = arguments[1];
//debugger;
alert(src.id);
alert(e.type);
}
div = document.getElementById("div1");
AttacheEvent(div, "onclick", "ShowMessage")
</script>
- AttachEvent
- attachEvent
- attachEvent
- attachEvent
- attachEvent() / addEventListener()
- attachEvent() / addEventListener()
- Javascript attachEvent
- attachEvent 传递参数
- attachEvent与addEventListener区别
- attachEvent和addEventListener
- attachEvent和addEventListener使用方法
- attachEvent/addEventListener注册事件
- 浅谈window.attachEvent
- fireEvent与attachEvent
- 浅谈window.attachEvent
- attachEvent与addEventListener区别
- attachEvent、addEventListener、detachEvent、removeEventListener
- attachEvent和addEventListener 使用方法
- [翻译]辉煌帝传说 第三章 生命之树(1)
- netlink (转)
- You Raise me up
- 11月5日加班
- http://info.hustonline.net/document/doc.aspx?ID=1740
- AttachEvent
- Web 开发工具箱之 Apache PHP MySQL 绿色套装版
- (转)人的正确思想是从哪里来的?
- 3.1~3.3
- 常用js代码备注.
- 希伯来语单词 11.6 (一)
- JAVA 异常
- 写我所想
- 3.4 3.5