I am using mustache PHP to render my html files and everything works correctly except in one case. There is a situation where I load an html file through an ajax call following this structure:
PHP - renders -> HTML - javascript appends -> HTML 2nd file
What I would like to do is to get the mustache parameters into the HTML 2nd file, as some data is generated in the initial PHP file and I wouldn't like to make another call to retrieve this data again.
- Do I need mustache js version for this ?
- How can I get the data from the PHP in js by using mustache?
- And how can I get the PHP rendered variables in the HTML 2nd file ?
What I can do is to insert hidden inputs to get the data from them in javascript but I would really like to avoid this practice. I don't like this practice as user can easily modify the inputs.
Any idea??