Hi.
I faced a task I can't resolve.
I have a DirectionResult object on the client side (in my .js file) which I need send to the server (to the Python function) and put it into the database (MongoDB).
How can I do this?
Now I'm trying to put the object into JSON string
for ex:
theRoute = JSON.stringify(directionsDisplay.getDirections());
then I'm sending it to server using POST method
$.post("/ajax/saveRoutePyth/", { csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val(), parName:name, parDesc:desc, parRoute:theRoute}, function(pois) { ....
But when I watch it on the server I can't see any functions which were inside the object.
Then I put the object into DB
When I'm trying to send this object back to client and do directionsDisplay.setDirections(object) this route doesn't appear on the map.
I wonder if this happens because of any functions were lost.
Am I right and if so how can I send this object to the server not using JSON?
Thanks a lot for your help
PS trying to solve it for 2 days....