我試圖從對象的responseText
屬性中刪除引號。從responsetext屬性中刪除引號
我的輸出是:
"[{"data":[[0,28]],"label":"Atyc-1"},{"data":[[0,13]],"label":"Atyc-10"},{"data":[[0,16]],"label":"Atyc-11"},{"data":[[0,17]],"label":"Atyc-2"},{"data":[[0,5]],"label":"Atyc-3"}]"
我需要的是:
[{"data":[[0,28]],"label":"Atyc-1"},{"data":[[0,13]],"label":"Atyc-10"},{"data":[[0,16]],"label":"Atyc-11"},{"data":[[0,17]],"label":"Atyc-2"},{"data":[[0,5]],"label":"Atyc-3"}]
@gdoron爲什麼我用blockquote的時候,代碼是一行代碼,而且代碼太長了。 – 2013-03-07 16:04:53
你嘗試過使用'substring'嗎? – 2013-03-07 16:05:21
嘗試類似'responseText.substring(1,responseText.length -1)' – 2013-03-07 16:05:24