Additionally, since you said its for your Intranet, you probably
wouldn't have much lag so I think speed either way. JSON would
probably have less data being transferred, but more overhead on the
client-side to process the data. HTML would have more data being
transferred, but less processing if all you're doing is just dropping
in the HTML.

Of course all of this depends on how much data is being returned.

On Mar 24, 8:21 am, James <james.gp....@gmail.com> wrote:
> I assume you're talking about returning data via AJAX?
> Returning HTML is probably the fastest if all you're doing is just
> inserting the HTML into the DOM.
> However, returning JSON gives you a lot more flexibility if you
> actually want to do something with the returned data, such as client-
> side calculations, formatting, parsing error statuses, or dropping
> data into different parts of the DOM (not just in one place), etc.
>
> I personally favored the JSON route even if I were merely just
> dropping in data on the page since it sort of keeps the HTML out of
> the server-side scripting (as that's usually the source of my AJAX
> responses.) I'd rather have HTML inside my JavaScript coding than in
> my server-side (e.g. PHP, ASP) coding.
>
> On Mar 24, 3:36 am, finco <mbeck...@gmail.com> wrote:
>
> > I am trying to figure the best way to maximize performance with data
> > returned from ASP pages.
>
> > Option one - return data in an HTML table.  Let the host page's css
> > format the table.
>
> > Option two - return json data from the asp page and let the browser
> > drop the data into a table and still let the host page do the final
> > formatting.
>
> > I guess the question is where the faster/least amount of processing
> > time and transport of data is used.  Other items of note - the
> > application is an intranet where all users will have javascript
> > enabled.
>
> > Your collective wisdom is greatly appreciated.
>
>

Reply via email to