I did a test:
<script>
function go() {
var a = "{tester.string1}";
alert(a);
}
function change() {
document.documentElement.innerHTML = document.documentElement.innerHTML.replace(/\{tester\.string1\}/, "replaced!");
}
</script>
<input type="button" value="Go" onclick="go();"/>
<input type="button" value="Change" onclick="change();"/>
The value of a
inside go()
changed after I clicked/called change()
(in Inspect Elements). However, the actual value appear in alert()
still shows {tester.string1}
. Does this mean the browser won't recompile anything after the page is loaded? (So it's static?) Is there any signal or call I can send to the browser (without reload) for this purpose? I'm not asking anything about eval()
. I just want to clarify the concept.