I am creating a website with Python, Javascript (JQuery) and AJAX. I know to execute a Python script with Ajax, but I don't know to return data to Javascript with Python.
For example, if there is a mistake in a form, I would like send an alert ("The mail is incorrect"). I know that with PHP, I can used echo "something" but I don't know how to take that with Python.
def secure_mail(mail):
if mail == "":
error = "the mail is empty"
print error
Thank you for your help !