- 浏览: 51431 次
- 性别:
- 来自: 深圳
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> </head> <body> </body> <script language="JavaScript" type="text/javascript"> <!-- var ul_val = document.createElement("ul"); for (var i = 0; i < 1000; i++) { var li_val = document.createElement("li"); li_val.innerHTML = (i + 1); ul_val.appendChild(li_val); } document.body.appendChild(ul_val); function getEventTarget(e) { e = e || window.event; return e.target || e.srcElement; } function editCell(e) { var target = getEventTarget(e); //其中target即是添加事件的dom元素 /*if (target.tagName.toLowerCase() === ‘td’) { // DO SOMETHING WITH THE CELL }*/ alert(target.innerHTML); } //function AttachEvent(target, eventName, handler, argsObject) { function AttachEvent(target, eventName, handler) { var eventHandler = handler; /*if (argsObject) { eventHander = function(e) { handler.call(argsObject, e); } }*/ //以上注释的代码不知道做什么 if (window.attachEvent){ //IE target.attachEvent("on" + eventName, handler); }else{ //FF target.addEventListener(eventName, handler, false); } } //AttachEvent(ul_val, "click", editCell, obj); AttachEvent(ul_val, "click", editCell); //--> </script> </html>
发表评论
-
JS的replace方法
2011-08-05 10:34 1138from http://www.cnblogs.com/mxw ... -
要写出在各大主流浏览器上都兼容的JS代码,就要关注他们的区别,下是IE和FF综合考虑的通用DOM!
2011-08-04 14:36 896来源于 http://hi.baidu.com/g ... -
<input type="text" id="start" />输入true取布尔true
2011-07-28 14:22 830"true" and true is di ... -
Js获取当前日期时间+日期验证+判断闰年+日期的天数差+日期格式化+JS判断某年某月有多少天
2011-07-27 17:47 4717字符串转日期型+Js当前日期时间+日期验证+判断闰年+日期的天 ... -
高效http页面优化法则一【JS对DOM的操作】
2011-07-08 10:58 996很多人都认为JS的效率 ... -
form page jump
2011-07-07 10:49 824页面跳转 <input type="hidd ... -
jquery widget sample
2011-07-06 08:39 3406<!DOCTYPE html PUBLIC &quo ... -
jquery apply wait for update
2011-07-05 10:36 1622<!DOCTYPE html PUBLIC &quo ... -
JS中的attachEvent、addEventListener如何传递参数
2011-06-29 14:02 6243<!DOCTYPE html PUBLIC " ... -
window.onload 和 $(document).ready 区别 待续......
2011-06-27 09:50 2717jquery 学习之一(js中window ... -
js operate frame
2011-06-14 14:04 1167我的页面框架如下 <frameset rows=&quo ... -
js中frame的调用
2011-06-14 12:27 1016js中frame的调用 关键词 ... -
js 事件冒泡 和其它问题
2011-06-10 09:25 779js事件冒泡 <html> <head> ... -
js inner iframe get dom of parent
2011-06-02 15:00 702parent.$("#id");//jqu ... -
ajax
2011-05-27 14:18 611<!DOCTYPE html PUBLIC " ... -
add event to all the dom elements in one page except one dom
2011-05-18 10:20 840<!DOCTYPE html PUBLIC &quo ... -
count down 倒计时
2011-05-13 12:42 550<!DOCTYPE html PUBLIC " ... -
js IE与FireFox的兼容性问题 事件
2011-05-13 09:16 985# window.event * IE:有windo ... -
deal with href remove the same element
2011-05-11 09:38 771var url="http://zhidao.bai ... -
document.form.item 问题集合的(0)和[0]取法
2011-05-09 15:10 1892<!DOCTYPE html PUBLIC " ...
相关推荐
HDR Deghosting: How to deal with Saturation, http://www.cs.duke.edu/~junhu/CVPR2013/
Beginning JavaScript with DOM Scripting and Ajax is an essential resource for modern JavaScript programming. This completely updated second edition covers everything you need to know to get up-to-...
Beginning JavaScript with DOM Scripting and Ajax is for the person who has a good grasp of HTML and CSS but wants to add JavaScript to their skillset. If you want to learn some basic programming ...
The Level 1 Specification was designed to deal with the following PHY layer interfaces : 1. 2. 3. 4. 5. 155.52 Mbps (SONET/OC-3c) 155.52 Mbps (8B/10B block coded) 100 Mbps (4B/5B TAXI) 44.1236 Mbps ...
高中英语 知识点大全41 deal with do with的区别
This driver doesn t deal with the exact protocol used during the session. It is intended to be as simple as something like.
Enlighten your understanding about the flight by performing step-by-step pre-flight adjustments and acquiring the instructions for a safe flight Get the best tips to deal with performance issues ...
Jan Newmarch, "Network Programming with Go: Essential Skills for Using and Securing Networks" English | ISBN: 1484226917 | 2017 | 274 pages | PDF | 2 MB Dive into key topics in network architecture ...
If your job is loaded with manual work, then why not write scripts that can deal with it for you? With this book, you will learn how to deal with many tasks such as zipping files, emailing colleagues...
Product Description Over 95% of computers around the ...* WSUS works with every Microsoft product, meaning any system administrator running a Windows-based network is a potential customer for this book
How do we deal with our problemsPPT教案.pptx
Foundations for Analytics with Python by Clinton W. Brownley Copyright © 2016 Clinton Brownley. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 ...
If your job is loaded with manual work, then why not write scripts that can deal with it for you? With this book, you will learn how to deal with many tasks such as zipping files, emailing colleagues...
further than the JavaMail API, which offers a protocol-independent model for working with IMAP, POP, SMTP, MIME, and all those other Internet-related messaging protocols. With the help of the ...
Many of Excel's 750 million users would like to do more with their data, such as repeating similar analyses over hundreds of files or combining the data in many files for analysis at one time....
The book also contains a great deal of practical advice for code developers and users; it is designed to be equally useful to beginners and experts.The issues of numerical accuracy, estimation and ...
At its core, Bayes' Theorem is a simple probability and statistics formula that has revolutionized how we understand and deal with uncertainty. If life is seen as black and white, Bayes' Theorem helps...
摸底考试作文垃圾处理how to deal with garbagePPT课件.pptx
Great software is something to marvel at: powerful, elegant, functional, a pleasure to work with as both a developer and as a user. Great software isn’t written by machines. It is written by ...
摸底考试作文垃圾处理how to deal with garbagePPT学习教案.pptx