Need to take value from the background database, in the SELECT tag to traverse the data inside the database
选择商品编号
The default select tag has only one
Click the plus sign below to add a row of data
the problem comes!!! Here we use the JS code to define a string , and then use the append of JQ to add to the node , generate a data table, but this time the select tag how to traverse the database , the PHP code written into the JS string inside, added to the page after the comment out , does not work.
So what's the best way to solve this?!!
So what's the best way to solve this?!!
So what's the best way to solve this?!!
Reply content:
Need to take value from the background database, in the SELECT tag to traverse the data inside the database
选择商品编号
The default select tag has only one
Click the plus sign below to add a row of data
the problem comes!!! Here we use the JS code to define a string , and then use the append of JQ to add to the node , generate a data table, but this time the select tag how to traverse the database , the PHP code written into the JS string inside, added to the page after the comment out , does not work.
So what's the best way to solve this?!!
So what's the best way to solve this?!!
So what's the best way to solve this?!!
Try it, I'm not testing.
选择商品编号
Here's what I wrote:
Your writing is too magical, JS and do not know PHP tags, of course, can not ...
Of course, if you put the code directly in the PHP file, with the script tag is also possible, but definitely not put in the JS file ...
The ideal way to do this is to use PHP to output the data in JSON format, and then JS parse the JSON, splicing code