1

I have been advised against using jQuery's .load() method

$('#result').load('ajax/test.html #result');

but I'm not really sure why.

Right now I have been using templates (mustache) to parse json returned from an ajax request, but the .load() method seems so much simpler.

The site I am working on is fairly heavy back-end (several of calls to services and a lot of data to be retrieved) but the data I need to replace sometimes requires quite complicated template markup.

Is there any good reason why I should be avoilding it?

Villem
  • 13
  • 3
  • Here are similar questions: [1](http://stackoverflow.com/questions/1775797/html-template-json-vs-server-html) and [2](http://stackoverflow.com/questions/1284381/why-is-it-a-bad-practice-to-return-generated-html-instead-of-json-or-is-it?rq=1) – rinat.io Aug 29 '13 at 13:46

0 Answers0