Passing a Java string to Javascript

前端 未结 1 906
梦如初夏
梦如初夏 2021-01-22 01:56

I am trying to load a table with data by initializing a Javascript variable with a string in JSON format. If I declare:



        
1条回答
  •  鱼传尺愫
    2021-01-22 02:47

    Try with quotes around.

    var data = new String("<%= d %>");
    

    0 讨论(0)
提交回复
热议问题