Answer the question
In order to leave comments, you need to log in
Passing data from php to js?
I know, the most banal question, but still how to do everything right?
ajax is not an option, a page is generated = a request to the database, make ajax = 1 more request to the database, somehow it is not logical ...
or make 1 request and return it right there?
What do you think?
Answer the question
In order to leave comments, you need to log in
well, I don’t know, I pass it like this for angularJs
<script type="text/javascript" charset="utf-8">
window.data = <?php echo CJSON::encode($data);?>;
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question