|
I'm creating a map editor in javascript, it uses raphaeljs and prototype, and have got to the stage where I need to persist the data to the server. Is there a good cross browser xml parser or would I be better off converting the map format to and from json on the server?
|
# ¿ Feb 2, 2009 23:48 |
|
|
# ¿ Apr 27, 2024 01:53 |
|
N.Z.'s Champion posted:JSON vs XML is mostly a question of which format represents your protocol data the best. If your map editor is about changing dots on a grid then that's probably a custom format that might be well-suited to JSON, but if your map editor is about adorning earth with notes then you may want to use a standard format such as KML (perhaps with a custom namespace for any custom data). The final result is going to be XML, so it would make sense from a protocol perspective it would make sense to use XML on the wire. My only concern is how easy the xml will be to parse on the client. I'll also see how easy it'll be to use DOM methods on the responseXml, that might be a viable route.
|
# ¿ Feb 3, 2009 14:26 |
|
rotor posted:alternately just suck it up and use the plain old DOM interfaces, they're really not that bad once you write about 40 lines of helper code, I can't believe people are actually recommending switching toolkits to avoid some simple DOM manipulation. And I thought -I- was lazy, sheesh. We've decided to use yaml instead of xml as the end format, so my life was just made a lot easier. Sometimes these things have a way of working themselves out. The only reason why I use prototype over jquery is because it comes bundled with rails and I <3 sam.
|
# ¿ Feb 4, 2009 18:39 |
|
I've been working furiously on my map editor over the last week and I've got to the point where my editor.js file is now longer than 600 lines. This is making it hard to navigate and I want to split it all up into smaller files. Is there a recommended way to do this?
|
# ¿ Feb 9, 2009 11:33 |