3
我想將Geo Location Position Object
轉換爲String
,這樣我就可以將它存儲到localStorage
中供以後使用。將對象轉換爲firefox中的字符串
現在我做了以下方法
$.toJSON(position)
JSON.stringify(position) // position is the object which return from Geo Location Success callback
jQuery.stringify(position)
通過使用上述所有的這些我不能在Firefox
得到String
還檢查該one,但它並沒有幫助這樣
FireFox控制檯結果
使用jQuery.stringify(position)
是'position'與內容的對象? – Cerbrus
是的,它包含時間戳和當前位置的座標@Cerbrus – Blu
而你嘗試過'localStorage.setItem('position',JSON.stringify(position));'? – Cerbrus