如何刪除以下代碼塊中的空白區域並存儲爲javascript變量?刪除Json中的空白區域
這是原來的格式
{ "info":"First Json",
"description":"Official Website",
"timestamp":"1337936081",
"rates":{
"USD":"840",
"CHF":"1319",
"BDT":"298",
}
}
這是格式我想
{"info":"Central Bank of Myanmar","description":"Official Website of Central Bank of Myanmar","timestamp":"1337936081","rates":{"USD":"840","CHF":"1319","BDT":"298","SGD":"632","JPY":"1053","GBP":"887","AUD":"759"}}
如果你想儲存在一個JS變量只是賦值給一個變量。就這麼簡單 – 2014-10-31 15:43:00
你爲什麼要刪除空白? – 2014-10-31 15:43:23
如果我不刪除空格,代碼不起作用。 – 2014-10-31 15:44:56