Write the logic in PHP or JavaScript to give?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
Write teaser network and suffer a little in doubt:
on the advertising site comprises a type code
which of course already loads a complete JS-code to generate a teaser block.
So I think — to convey to the client already rendered block (the logic in php), or to give only the block data in e.g. JSON format, and render it by means of JS (logic in JS)?
by | 4 views

4 Answers

0 like 0 dislike
For maximum download speed take all the rendering logic in a separate static JS script and compress gzip-om and the data block in the JSON load. Static JS Takashimaya and all will fly :-) Also can be placed several blocks on the same page and treat them all the same one JS and not shipping for each HTML.
by
0 like 0 dislike
On the client side it makes sense to carry out any task if it:
— saves server resources and/or acceleration of loading of pages/data;
— not too greatly complicates the support;
— does not prejudice the security (say, to check the correctness of filling out forms without duplication on the server side, Javascript should not be used).
by
0 like 0 dislike
Teaser and the unit is not in the Iframe is displayed? Ah good(((((
by
0 like 0 dislike
If the JavaScript is in any case already required, why not use it to the max, unloading the server from executing code?
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
27,379 users