www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
 onoffline Event
onoffline Event
New for Windows Internet Explorer 8

Raised when Internet Explorer is working offline.

Syntax

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

Event Information

BubblesNo
CancelsNo
To invoke Set the browser 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 position relative to a relatively positioned parent element.
y Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.

Remarks

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

This event is supported on Windows Vista only.

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. {
    document.body.
    document.body.
}  

Standards Information

There is no public standard that applies to this event.

Applies To

BODY
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG