ajax - create html elements on the serverside VS get data as JSON and create tags with javascript -
i want create ajax search find , list topics in forum (just topic link , subject). question is: 1 of methods better , faster?
get threads list json string , convert object, loop on items , create
<li/>
or<tr>
, write data (link, subject) , append threads list. (jquery powered)get threads list wrapped in html tags , print (or use
innerhtml
,$(e).html()
)
thanks...
i prefer second method.
i figure server-side have either convert data json or html format why not go directly 1 browser understands , avoid having reprocess client-side. can adapt second method degrade gracefully users have disabled javascript (such still see results via standard non-js links.)
Comments
Post a Comment