« EditPlus正则表达式替换字符串详解 301 Redirect 永久重定向的实现 »

利用javascript在页面上点击任一链接时触发一个事件的代码

在页面上点击任一链接时触发一个事件的代码

  1. <script language=javascript>
  2. document.onclick = function(e)
  3. {
  4. var o = window.event.srcElement;
  5. if (o.tagName=="A")
  6. {
  7. alert("这里放你的处理代码!")
  8. }
  9. }
  10. </script>

回复留言

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

你可以使用XHTML标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>