Search code examples
aframe

Hey everyone, I am trying to dynamically change the a-text value based on the URL parameters


https://github.com/rohanshiva/pass/blob/master/index.html Basically, the user submits a form with name, the form generates a QR code. The qr code will basically contain the link to the ar.html page with url parameters like this - jackdorsey.github.io/ar.html?name=rohan I am able to successfully get the value using new URLSearchParams(window.location.search), but I don't know how to set the a-text value based on the url parameters. Any help would be awesome. It is fine if its just changing a-text


Solution

  • Create a component and call this.el.setAttribute('value', 'your string')

    Working example: https://glitch.com/edit/#!/shore-haumea?path=change-text.js:1:0