get data from mysql database to use in javascript

后端 未结 4 1779
攒了一身酷
攒了一身酷 2020-12-13 05:51

I have a javascript that dynamically builds an html page. In the html page there are textarea boxes for the user to type information in. The information already exists in

4条回答
  •  时光说笑
    2020-12-13 06:19

    Do you really need to "build" it from javascript or can you simply return the built HTML from PHP and insert it into the DOM?

    1. Send AJAX request to php script
    2. PHP script processes request and builds table
    3. PHP script sends response back to JS in form of encoded HTML
    4. JS takes response and inserts it into the DOM

提交回复
热议问题