File: js/remote_loader.js

Recommend this page to a friend!
  Classes of Martin Latter  >  JavaScript Monitor URL Changes  >  js/remote_loader.js  >  Download  
File: js/remote_loader.js
Role: Example script
Content type: text/plain
Description: Example script
Class: JavaScript Monitor URL Changes
Display the status of accessing a URL in a page
Author: By
Last change:
Date: 1 year ago
Size: 426 bytes


Class file image Download
    * Set-up onload event handler for traffic light monitoring an external URL.

window.addEventListener('load', function() {

    "use strict";

        sRemoteURL = "http://www.bbc.co.uk/",
        iCheckInterval = 2000, // 2 secs
        oTrafficLight1 = new TrafficLight(),
        sTL1 = oTrafficLight1.create("traffic-light-1");

    oTrafficLight1.monitor(sRemoteURL, iCheckInterval, sTL1);

}, false);