What is different between datatype : json call and datatype : html call from ajax ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

What is different between datatype : json call and datatype : html call from ajax ?

30th Mar 2018, 6:30 PM
Muhafil Saiyed
Muhafil Saiyed - avatar
2 Answers
+ 1
If you want to just place some html into web page -use html. If you need to do some calculation or data modification - use json.
30th Mar 2018, 6:45 PM
Damyan Petkov
Damyan Petkov - avatar
- 1
and what should be return from controller in both the scenario ? when using json like return json.serialize(data)
30th Mar 2018, 6:52 PM
Muhafil Saiyed
Muhafil Saiyed - avatar