Can tvml Dom be manipulated in js

looking at the new docs it isn't clear if you can use tvml and the JS framework to manipulate the dom or if you can only pass back static markup from the server and limit the JS code to responding to events and loading new content from the server


Yep. That's the case. I'll file a bug report. Thanks.

Following this logic navigationDocument.replaceDocument(new, old) would also work yes?

I would love to see a link to what you have done. I am stuck. I am calling a function and updating the DOM this way:



load: function(event) {

var self = this,

ele = event.target,

url = ele.getAttribute("url")


if(url) {

var count = 0;

setInterval(function() {

count = count + 1;

var info = getActiveDocument().getElementById("seconds");

console.log("GetActiveDocument: " + info.parentNode.innerHTML);

info.textContent = count.toString();

console.log("Seconds: " + info.textContent);

}, 1000);

}

}

I can see that it works in the logs but the UI page is not refreshing. Please Help!

Hey Jefferbo!


I am experiencing an identical issue. Any luck getting the UI to render the updated DOM? I am having a similiar problem below. I have not been able to see an example anywhere.


I am calling a function and updating the DOM this way:



load: function(event) {

var self = this,

ele = event.target,

url = ele.getAttribute("url")


if(url) {

var count = 0;

setInterval(function() {

count = count + 1;

var info = getActiveDocument().getElementById("seconds");

console.log("GetActiveDocument: " + info.parentNode.innerHTML);

info.textContent = count.toString();

console.log("Seconds: " + info.textContent);

}, 1000);

}

}

I can see that it works in the logs but the UI page is not updating.

We ended up just restarting our app when we needed to update the lockup overlay since this bug didn't get fixed in time. It's a one-time thing after activation so not ideal but it works for now.


Not sure why your specific case isn't working, tvoscoder. It seems updating the DOM updates the interface for some things but not for others. Hopefully Apple will better clarify soon what is and isn't possible to update.

Can tvml Dom be manipulated in js
 
 
Q