say you’ve got a normal symbol on several scenes. this symbol contains a single rect with a class ‘test’.
onsymbolload you run element.getElementsByClassName('test')[0].innerHTML = 'test'
across the document every of these symbols will contain ‘test’
Thanks for the help @h_classen heres my working solution. Seems to be working as intended now but little more testing to be done.
var outputText = ‘’;
if (!localStorage.visited) {
var xmlhttp = new XMLHttpRequest();
var url = "${resourcesFolderName}/correctModalTEXT.json";
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var data = JSON.parse(xmlhttp.responseText);
loadSceneText(data);
return false;
}
}; // close 3data
xmlhttp.open("GET", url, true);
xmlhttp.send();
function loadSceneText(data) {
var CMText = element.getElementsByClassName('correctModalTEXT');
for (var i = 0; i <= data.pageContent.length; i++) {
var text = data.pageContent[i];
for (key in text) {
if (text.hasOwnProperty(key)) {
outputText += '<u>' +
text[key] +
'</u>';
CMText[i].innerHTML = text[key];
} // hasOwnProperty check
} // for each object
} //for each array element
} //close displayScene()
} // close (if else)
else { }
//end
Yes thanks, the data in my user feedback symbol does not change from scene to scene so the function will load my json data as seen here view sample scene > allowing for multiple languages and easy editing ! It works so im happy cheers @h_classen