s ravi chandran wrote:Or are you talking about sending the individual map Object which is being created?
You cannot send objects. Only strings. Hence the JSON. Or individual properties as strings.
I am thinking of avoiding Json as of now.
JSON, not Json. And if you want to "pass" JavaScript objects back and forth, you'll need to get over your aversion.
Also, the way I am creating the object in JavaScript , is that optimal way?
No. It's pretty sloppy. Here's a few pointers:
ObjectMap is a bad name. What is it really? Also, like in Java, lowercase first character.ObjectMap ["ID"] is not the standard way to express this. Never use the [] notation for fixed property names, and property names should be in camel case just like variables. So objectMap.id and objectMap.name, and so on.When you do use [], no space between the name and the braces.I don't understand what the array is for.