I realize that I'm on XML.com, but....
2005-04-01 07:04:20 mdchaney
[Reply]
How exactly do you return JS Objects in the response? What should be the document type?
Your code looks fine. Just use "text/plain" for the document type. When I do this locally, I simply use ".txt" files.
I just finished a simple application for a client which has a 2.5M data file, the entirety of which is a humongous JS object literal. Loading it locally, including file reading, parsing, and object creation, takes about 2-3 seconds on my computer here (1.8GHz with plenty of RAM). The application is incredibly fast, particularly for dealing with a lot of data.
Using XML DOM in such an application would bloat the data file by at least 25-30% (just looking at adding end tags), and bloat the code by an obnoxious amount by having to deal with DOM instead of simple object properties.