1
我想通過在遊戲框架視圖如何通過Scala的地圖[字符串,地圖[字符串,字符串]]以普通JavaScript對象
斯卡拉值映射到JavaScript的JSON onject我得到「語法錯誤:JSON。解析:意外的字符在1號線JSON數據」的第10列當我檢查下面的代碼
val mapTobePassToJs = Map(
"cg1" -> Map(
"path" -> "/var/logs/cdr1/cdr",
"name" -> "CG-1"
),
"cg2" -> Map(
"path" -> "/var/logs/cdr2/cdr",
"name" -> "CG-2"
),
"cg3" -> Map(
"path" -> "/var/logs/cdr3/cdr",
"name" -> "CG-3"
),
"cg4" -> Map(
"path" -> "/var/logs/cdr3/cdr",
"name" -> "CG-4"
)
)
<script type="text/javascript">
var aChartList = jQuery.parseJSON("@JSONObject(mapTobePassToJs).toString()".replace(/"/g,'"'));
</script>
請人幫我
感謝您的建議 – Muhunthan
歡迎您:)快樂編程! –