How to dynamically change entity property periodically

Suppose I've a php page that does some calculation, updating some variables and sending them to JavaScript code in html page every 20 seconds. Is it possible to use these variables to set an entity property in a way that the entity property dynamically changes as the variable changes?

Add: javascript is calling the php variables using a ajax request like that:

$.ajax({ url: "getstatus2.php", async: false, cache: false, dataType: 'json', success: function(data) { TA_1 = data.TsysA1;

and all the other variables

1 answer

  • answered 2017-10-11 10:13 W. Murphy

    In your success callback, you could make setAttribute calls to update the A-Frame entities.

    You could also use Kevin Ngo's state component to set up bindings with Redux, in which case you would emit an event in your ajax success callback to pass the data and trigger the updates.