transfer a Variable from php to js

前端 未结 3 1702
野的像风
野的像风 2020-12-22 07:32

I got really confused when i tried to transfer variables from php to js. everything is fine when i try to get value using an id
for example:

var name = $         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-22 08:10

    Not quite. Encoding as JSON will ensure that it is a valid JavaScript literal.

    var num = 
    

提交回复
热议问题