Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Events
 ononline Event
ononline Event
New for Windows Internet Explorer 8

Raised when Internet Explorer is working online.

Syntax

Inline HTML<ELEMENT ononline = "handler" ... > All platforms
Event propertyobject.ononline = handlerJScript only
object.ononline = GetRef("handler")Visual Basic Scripting Edition (VBScript) 5.0 or later only
Named script <SCRIPT FOR = object EVENT = ononline> Internet Explorer only

Event Information

BubblesNo
CancelsNo
To invoke Clear the check next to "Work Offline" on the File menu.
Default action N/A

Event Object Properties

Although event handlers in the DHTML Object Model do not receive parameters directly, a handler can query the event object for the following event properties.

Available Properties

clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
offsetX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.
offsetY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.
screenX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.
screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.
srcElement Sets or retrieves the object that fired the event.
type Sets or retrieves the event name from the event object.
x Sets or retrieves the x-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.
y Sets or retrieves the y-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.

Remarks

If Asynchronous JavaScript and XML (AJAX) Connection Services are disabled, this event is not raised. (These services are enabled by default.)

Example

The following example sets an event handler that responds to both ononline and onoffline events using the type property of the event object.

function reportConnectionEvent(e)
{
    if (!e) e = window.event;
    
    if ('online' == e.type) {
        alert( 'The browser is ONLINE.' );
    }
    else if ('offline' == e.type) {
        alert( 'The browser is OFFLINE.' );
    }
    else {
        alert( 'Unexpected event: ' + e.type );
    }
}
window.onload = function() {
    document.body.ononline = reportConnectionEvent;
    document.body.onoffline = reportConnectionEvent;
}  

Standards Information

There is no public standard that applies to this event.

Applies To

BODY, HTMLBodyElement Constructor

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
As of IE8b2, also available on Windows XP      bedney   |   Edit   |   Show History

All -


As of IE8 beta2, this event is now available on Windows XP (as per my request :-) ). Thank you Microsoft!


Cheers,


- Bill

Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker