Changeset 363 in tmcsimulator for trunk/webapps/EInotebook/notebook.js


Ignore:
Timestamp:
04/11/2019 10:35:31 AM (7 years ago)
Author:
jdalbey
Message:

Implement #136 to read script file name from a config file. EInotebook v0.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/EInotebook/notebook.js

    r359 r363  
    3030function setupNotebook() 
    3131{ 
     32   console.log("setupNotebook() starting"); 
    3233   changeTab('summaryTab'); 
    3334   showContent('summaryPageContent') 
     
    138139    }); 
    139140} 
    140 // Load the dynamic json file for highways, etc. 
    141 function loadJSON(inFile, callback) 
    142 { 
    143     var xobj = new XMLHttpRequest(); 
    144     // Assume XML unless filename ends with .json 
    145     if (inFile.endsWith(".json")) 
    146     { 
    147         xobj.overrideMimeType("application/json"); 
    148     } 
    149     xobj.open('GET', inFile, true); 
    150     xobj.onreadystatechange = function() 
    151     { 
    152         if (xobj.readyState == 4 && xobj.status == "200") 
    153         { 
    154             callback(xobj.responseText); 
    155         } 
    156     }; 
    157     // We want ajax to ignore any cached responses 
    158     xobj.setRequestHeader('If-Modified-Since', 'Sat, 01 Jan 2000 01:01:01 GMT') 
    159     xobj.send(null); 
    160 } 
    161141/** 
    162142 * Selects a new tab to be viewed.  
Note: See TracChangeset for help on using the changeset viewer.