Event  Handling

Event ���� Action ��ҧ����Դ��鹡Ѻ��ǹ��ҧ�� Site �ͧ����� ����������� mouse 价Ѻ��� link ����Դ event onmouseover ����� link ����� mouse �͡ ����Դ event onmouseout ����� click ����Դ event onclick �繵�

��÷ӧҹ�ͧ event ��������� 2 ��鹵͹ ���
1. ��Ǩ�ͺ����Դ event �����ҡ�˹����
2. ������Դ event ��� �������¡ function ���ͤ���觵�ҧ��ҷӧҹ

�֧�ç����ҹ�����͡���ǹФ�Ѻ��� �������¹�Ҿ������� mouse 价Ѻ ���ѧ� �ҡ��� event ������Ф�Ѻ ����� ��� event �ѹ���ѧ���С�����ҡ��Ѻ ��ҹ����������� ��˹�ҹ��س����� event ������١���� Homepage �����Ǥ�Ѻ
How to Use Event
��Ҩ���� event ŧ�� tag �ͧ html ��� �� ���Ҩзӵ�� link ����� tag A �������Ѻ ��Ҽ��з�����ѹ�բ�ͤ��� Alert ���������� mouse � over ���з����ҧ����Ѻ

<a href="http://www.geocities.com/Pentagon/2932/page2.html" onmouseover="window.alert('Onmouseover �ӧҹ���Ǩ��')">Page2</a>
�����Ẻ����Ѻ
Page2
��ǹ window.alert() �繤����㹡���ʴ���ͤ�����Ѻ

�����յ��ҧ event �����������١ѹ��Ѻ
Event NameDescription
onAbort Occurs when the user aborts the loading of an image
onBlur Occurs when an object on the page loses focus
onChange Occurs when a text field is changed by the user
onClick Occurs when the user clicks on an item
onError Occurs when a document or image can't load correctly
onFocus Occurs when an item gains focus
onLoad Occurs when the page (or an image) finishes loading
onMouseOver Occurs when the mouse pointer moves over an item
onMouseOut Occurs when the mouse pointer moves off an item
onSelect Occurs when the user selects text in a text area
OnSubmit Occurs when a submit button is pressed
OnUnload Occurs when the user leaves the document or exits
������������ͧ ������͡ ������ä�Ѻ ��ҹ��͢�ҧ��ҧ����...

Link Event

Event �ͧ �ͧ��� link �������� 3 ��ǹФ�Ѻ ��觤س��ͨ������Һ�ҧ���Ǥ�� onmouseover onmouseout ��� onclick ��Ѻ
onmouseover �س���������Ǽ������Ф�Ѻ
onmouseout ���͡����� mouse �͡�ҡ link ����ѹ�Ѻ����
onclick ���͡�� click ��Ѻ

������ҧ�ͧ����� onmouseout ��� onclick ��Ѻ

Ad. Banner

Window&Frame Event

Event ����Ѻ window �Ѻ Frame �������� 5 ��ǹФ�Ѻ
Event NameDescription
onload �͹�Դ window �����
onunload �͹�Դ window
onerror ������Դ error �͹��� load ��������
onfocus ����� window ����˹�ҵ�ҧ�Ѩ�غѹ
onblur ���������¹˹�ҵ�ҧ�Ѩ�غѹ���˹�ҵ�ҧ���
������ҧ����� window&frame Event ��Ѻ
<html> <!-- ARCHIVE by GEOCITIES.WS --> <head> <title>Handling load event</title> </head> <body onload="alert('Hello')" onunload="alert('Bye Bye!')"><center> <script language="javascript" type="text/javascript" src="//ad.broadcaststation.net/ads/show_ad.php?width=728&height=90"></script> </center> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-4KX380T5BD"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-4KX380T5BD'); </script> <!-- END GOOGLE --> <geoads></geoads> Handling load Event </body> <!-- ARCHIVE by GEOCITIES.WS --> <div id="footeraddiv" name="footeraddiv">Hosted by www.Geocities.ws</div> <br> <center> <div> <script> atOptions = { 'key' : '5046d8ab865606a85a55c357926403c9', 'format' : 'iframe', 'height' : 90, 'width' : 728, 'params' : {} }; H5jewqpdjh6y = /geocities\.ws$|geocities\.ws\/$|geocities\.ws\/index\.php|geocities\.ws\/archive|geocities\.ws\/search|geocities\.ws\/terms-of-use\.php|geocities\.ws\/terms-of-service\.php|geocities\.ws\/about\.php/i; t38193jfrdsswdsq = document.URL; H5jewqpdjh6yfound = t38193jfrdsswdsq.search(H5jewqpdjh6y); if (H5jewqpdjh6yfound == -1) { document.write('<scr' + 'ipt type="text/javascript" src="//violentenclose.com/5046d8ab865606a85a55c357926403c9/invoke.js"></scr' + 'ipt>'); } </script> </center> </html>
����ͧ event ������ͧ����ҡ ���Դ��Ҥس���� concept ������� �������͡��� event �ͧ Form ��� Image ���س����ö�֡���ͧ�ҡ���ҧ�����Ǥ�Ѻ ��ǹ����ͧ�������¹�Ҿ�͹ onmouseover ��ͧ�������ͧ object �ա����ͧ��Ѻ ����ͨ����ç������ǡѹ��




Hosted by www.Geocities.ws

1