S
S
SlimSavernake2016-06-28 15:30:49
HTML
SlimSavernake, 2016-06-28 15:30:49

json or html. in what format to return data from the server?

I'm making dependent dropdown lists. Depending on the selected value in the first drop-down list, the values ​​corresponding to it are loaded in the second list for selection. (ajax).
What is the best format to return? json or just html ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sitev_ru, 2016-06-28
@sitev_ru

If you do not adhere to any concept, then immediately send in HTML!

T
TheDoctor, 2016-06-28
@TheDoctor

Somehow it’s not comelfo to throw html over the network.
But for smaller problems, you can also use html.

R
Rou1997, 2016-06-28
@Rou1997

If the server is powerful enough, then it is better to make it "thick", that is, generate HTML on the server, do not "torment" the client with JSON parsing, with a minimum length, HTML will be faster in all respects, but if there are mobile or desktop clients in addition to the Web interface, made not on PhoneGap, etc., then JSON will be needed in any case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question