Update: this turned out to be a memory cache issue where both Firefox and Chrome were pulling the properties.js file from memory cache on each page refresh instead of downloading a fresh version from the server. The Network tab tip from below comments allowed me to see this behavior. Thanks for that!
Using meta tagging in the HTML files as follows did not help at all:
<meta http-equiv=“Pragma” content=”no-cache”>
<meta http-equiv=“Expires” content=”-1″>
<meta http-equiv=“CACHE-CONTROL” content=”NO-CACHE”>
I am developing a UI dashboard with multiple HTML5 pages that show values that change every few minutes. The values come from APIs that I parse with JQ and then use bash to update a properties.js file. The multiple HTML5 pages src this properties.js file to assign values to JavaScript variables in the HTML5 pages.
The problem is, this works for the 1st HTML5 page but the 2nd HTML5 page is not getting the values. If I comment out the 1st page's "src" line, the 2nd page gets the values. Seems the way I am doing this is only good for populating values into a single HTML5 page. I would rather not clone the properties file for each HTML page. I am trying to find a way to make all HTML5 pages populate the values from a single properties.js file.
[FILE1.HTML]
<head>
...
<script type="text/javascript" src="./properties.js"></script>
...
</head>
<body>
...
<main>
...
<div class="text-value" id="ts1_info.var1"></div>
...
<script type="text/javascript">
document.getElementById("ts1_info.var1").innerHTML = ts1_info.var1;
</script>
...
</main>
</body>
[FILE2.HTML]
<head>
...
<script type="text/javascript" src="./properties.js"></script>
...
</head>
<body>
...
<main>
...
<div class="text-value" id="ts1_info.var1"></div>
...
<script type="text/javascript">
document.getElementById("ts1_info.var1").innerHTML = ts1_info.var1;
</script>
...
</main>
</body>
[PROPERTIES.JS]
var ts1_info;
ts1_info = {
var1: "my_value",
...
;
[File Hierarchy]
page1.html
|
|_ page2.html
|_ properties.js
In page1.html the src line is going down 1 level as such:
<script type="text/javascript" src="./sub_directory/properties.js"></script>
In page2.html the src line is going to the same level:
<script type="text/javascript" src="./properties.js"></script>