這是我的代碼: // get from ajax
$.ajax({
'async': false,
'global': false,
'url': url,
'dataType': "json",
'success': function (d) {
data = d;
// code here to define & c
我想將Geo Location Position Object轉換爲String,這樣我就可以將它存儲到localStorage中供以後使用。 現在我做了以下方法 $.toJSON(position)
JSON.stringify(position) // position is the object which return from Geo Location Success callback