getting data from query sql database to javascript

后端 未结 2 1932
生来不讨喜
生来不讨喜 2021-01-06 23:17

I have a problem with my code.
case like this:
I have a dropdown, if selected \"personal\" it appeared the new dropdown that contains the data that is retrieved from

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 23:47

    The best way would probably be with an ajax call, anyway if you are declaring the script in the same page with the php, you can json encode the array with the options so that you will be able to access it into the javascript, like this:

    var optionIds = 
    var optionNames = 
    

提交回复
热议问题