Skip to content

Category: Questions

Calling JavaScript from component template

I’m working on integrating payment forms from a third party, by using the Link to Javascript they provide. when I place the code in the index.html page its works just fine, but when I move the code to the component template is not working, below is part of the code: this is the script code to initialize…

How to format a string of html in json

I am working on a tool for generating html files. The code is fairly simple. A user clicks a post button and the content from a textarea is sent to an endpoint. I have tried posting the html as a json string. Expected The saveContent method is called. The value from the textarea element is concatenated into a…

Copy scrollTop value from textarea to div

I have a div and a textarea inside a parent div. I am trying to copy the scrollTop value of the textarea to the div so it moves in sync with the textarea scrolling. The problem seems to be when i add text into the textarea and then press enter for a new line, the div scrollTop value doesn’t seem