Passing array values to js

后端 未结 2 444
难免孤独
难免孤独 2021-01-25 13:16

So current setup is as following:

PHP:data.php



        
2条回答
  •  轮回少年
    2021-01-25 13:30

    You can use a hidden field:

    
    

    And then you can parse the input value from javascript:

    var data = $.parseJSON($('#my-data').val());
    

提交回复
热议问题