I have a number of variables stored in an external file (settings.js):
var company = "Apple";
var city = "Toronto";
var weather = "Sunny";
In my HTML I'm referencing jQuery and settings.js where all variables will be stored. The code between the body
tags looks something like this:
<div class="company"></div>
<div class="city"></div>
<div class="weather"></div>
I'm trying to make some smart jQuery code which will read through the settings.js file, find variable and load it, then find HTML element with the same class name as variable, and finally update the content of that element with variable value.
After executing the function HTML should look like this:
<div class="company">Apple</div>
<div class="city">Toronto</div>
<div class="weather">Sunny</div>
Note: There might be multiple locations inside HTML with the same class name. All this will be running locally in FF. This is test/demo project so I'm not too worried about the performance.