Using JSON.parse() is returning [object] and not the original input

Hello
I am storing some coordinates in a database, I do this using JSON.stringify method to convert an array of coords into a string. This works fine but when I try to reload the coords using JSON.parse() I don’t get the original coords back instead I get [object Object],[object Object].

here is the code.

<script type="text/javascript" src="json2.js"></script>
function save_route()
{
	alert(path);
	var str = JSON.stringify(path);
	document.dataForm.routeMarkers.value = str;
	alert(str);
}

this converts an array of coords eg (51.50439265195253, -3.3535325679687276),(51.53259269613245, -3.2134568843749776)

into

[{“Oa”:51.50439265195253,“Pa”:-3.3535325679687276},{“Oa”:51.53259269613245,“Pa”:-3.2134568843749776}]

function load_route(){
	var loadStr = document.dataForm.routeMarkers.value;
	alert(loadStr);
	loadPath = JSON.parse(loadStr);
	alert(loadPath);
}

when I try use this instead of getting the original coords back i get
[object Object],[object Object]

(the alerts are just to see what is going on)

Thanks for any help

When you use JSON.parse it returns the string back to its original state which is an object, all you need to do is use something along the lines of the following example.

var loadPath = JSON.parse(loadStr);
alert(loadPath[0].Pa); // Returns the second result of the first array

Thanks SgtLegend
I thought that after I parsed the string back then the alert would be exactly the same as is was before being stringified, but what you said was right and has got the code working, so thanks alot.

No problem