javascript - Optimization: Loading content using ajax -


i want hear ideas on optimizing loading of content using ajax. next, propose few ways of doing , i'll come own thoughts each one.

  • loading html directly - this allows load content not further computation needed. more suited content not affected user operations or content parts should updated regularly
  • getting json object server - seems way have content of page in json object. allows modifying parts comparing current values new object
  • loading parts (chunks) - might seem hardest way update. have know part's changed , load (specific dom access node should changed/updated). also, computational stand point seems easier getting json object , 'manually' creating tags or having template load data into

so, think each approach? feel free propose new approach!

well work in enterprise software field (as mere consultant, not developer ;) ) , i've seen many times third approach used extensively because it's more flexible in terms of dynamicity of page.

aside first 2 approaches don't seem compelling point of view of updating parts: in second case (using json) have compare 2 page fragments, think it's naive approach (and not mantainable, fear).

but question lacks important information, using generate page. less important in first case because generating string (which contain page soure code) can become mess in third case if ajax loading code interferes html templating engine using.

i hope helps , please add more information question if need to!


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -