Answer the question
In order to leave comments, you need to log in
JS - Storing data in an html page - how much is correct?
Good evening.
In one of the pages in an asp-net project, I plan to store the date for later actions - in a hidden html div of the page.
In order to subsequently receive this value from several event handler functions.
Tell me how correct it is to use this approach and how else you can create "global" variables in javascript
Answer the question
In order to leave comments, you need to log in
you can generate a view script:
<script>
window.varibleName = {yourData: 'foo'};
</script>
Not at all correct.
Use redux as a last resort and local storage will do.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question