Answer the question
In order to leave comments, you need to log in
How to send json file to browser using django?
I am writing an anonymous chat, I need to send a message sent by one user without reloading the page, users are naturally not authorized, users have a common chat number. I need the server to send the json file to the user, and js accepts it.
Answer the question
In order to leave comments, you need to log in
About the server itself sends the data. On the client side, you still have a script that receives data and parses json, so set a timeout of 2 seconds for this script, let it ask the server for data every two seconds
javascript.ru/setTimeout
anonymous chat
Note, I'm already using HttpResponse, I need to send a message to the second user.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question