انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية تكنولوجيا المعلومات
القسم قسم شبكات المعلومات
المرحلة 3
أستاذ المادة حۡــسۜــنۨ ا̍ڷــڔهــٻۧــمۘــې
3/6/2012 9:55:26 PM
OnBlur Event Def : Fires when the object loses the input focus.
To invoke • Click the mouse on the document background or another control. • Use the keyboard to navigate from one object to the next. • Invoke the blur method when an object has focus. • Switch focus to a different application or open a second window. Default action : Switches focus away from the object on which the event is fired.
Remarks
- The onblur event fires on the original object before the onfocus or onclick event fires on the object that is receiving focus. Where applicable, the onblur event fires after the onchange event.
- Use the focus events to determine when to prepare an object to receive or validate input from the user.
- For Internet Explorer 5 and later, the onblur event is asynchronous.
Example :This example shows how to display the name of the object that has lost focus, that is, the object that fires the onblur event
<html><body> <input type="text" name="txtFName" value="First Name" onblur="alert(event.srcElement.name)"> <input type="text"name="txtLName" value="Last Name" onblur="alert(event.srcElement.name)"> <input type="text" name="txtPhone" value="Phone" onblur="alert(event.srcElement.name)"> </body></html>
OnLoad Event
Def : Fires immediately after the client loads the object. Syntax : <ELEMENT onload = "handler(event);" >
To invoke : Open a document to invoke this event for the document or any object within it.
Remarks
The client loads applications, embedded objects, and images as soon as it encounters the applet, embed, and img objects during parsing. Consequently, the onload event for these objects occurs before the client parses any subsequent objects. To ensure that an event handler receives the onload event for these objects, place the script object that defines the event handler before the object and use the onload attribute in the object to set the handler.
The onload attribute of the body object sets an onload event handler for the window. This technique of calling the window onload event through the body object is overridden by any other means of invoking the window onload event, provided the handlers are in the same script language.
Example
The following example shows how to declare an onload event for a document that is designed to work with multiple browsers and earlier versions of Internet Explorer.
<!doctype html> <head> <title>Load Event Sample</title>
<script type="text/javascript"> function doLoad() { alert( "The load event is executing" ); }
if ( window.addEventListener ) { window.addEventListener( "load", doLoad, false ); } else if ( window.attachEvent ) { window.attachEvent( "onload", doLoad ); } else if ( window.onLoad ) { window.onload = doLoad; } </script>
</head>
<body> <h1>Load Event Sample</h1> <p>This sample demonstrates how to execute an event while the document is loading.</p> </body> </html>
Please Notice that the entire events and their explained examples are embedded in the Attached File ...
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|