playframework JsValue in HTML Template

前端 未结 1 1494
逝去的感伤
逝去的感伤 2020-12-11 03:07

I\'m trying to define a json object in the template with the JsValue of play (v2.2.2). The problem is, \" is converted to "



        
1条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-11 03:49

    Define it as Html so it doesn't automatically get escaped.

    var org = @Html(Json.stringify(Json.toJson(org)));
    

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