Question

I see that most of big websites are returning javascript objects instead of pure HTML output, and renders it client side.

What are the advantages of using this approach? (and I think they are when used by Google, FB and others).

I think that one of the advantages is that it doesn't "freezes" the browser when inserting new html into the page. Freeze problem

Also is it easy to transfer / process it if you have a good javascript API.

Do you know others?

Javascript Objects Return

Était-ce utile?

La solution

That is the JSON data format, not JavaScript objects (although the syntax is compatible).

JSON is:

  • Lightweight
  • Structured
  • Well supported by libraries for just about every programming language out there

instead of pure HTML output

The particular example you give has embedded HTML. Presumably the request is for more then a single piece of content to insert into a single part of the page.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top