`

Prototype笔记(八)----Event扩展

    博客分类:
  • ajax
阅读更多
observe(element, name, observer, useCapture) static element: object or id, name: event name (like 'click', 'load', etc), observer: function to handle the event, useCapture: if true, handles the event in the capture phase and if false in the bubbling phase. 为对象的某个事件增加一个处理函数。

<script>
Event.observe(window, 'load', showMessage, false);
function showMessage() {
alert('Page loaded.');
}
</script>


<script>
Event.observe($(inc_SchoolName[mark]), 'focus', function() {shows(mark)});

</script>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics