Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
jonnii
Dec 29, 2002
god dances in the face of the jews
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?

Adbot
ADBOT LOVES YOU

jonnii
Dec 29, 2002
god dances in the face of the jews

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.

jonnii
Dec 29, 2002
god dances in the face of the jews

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.

jonnii
Dec 29, 2002
god dances in the face of the jews
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?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply