Skip to content

Latest commit

 

History

History

javascript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

JavaScript Ajax Example

Demonstrates how to post form data and process a JSON response using JavaScript. This allows making requests without navigating away from the page. Demonstrates using fetch, XMLHttpRequest, and jQuery.ajax. See the Flask docs about JavaScript and Ajax.

Install

$ python3 -m venv .venv
$ . .venv/bin/activate
$ pip install -e .

Run

$ flask --app js_example run

Open http://127.0.0.1:5000 in a browser.

Test

$ pip install -e '.[test]'
$ coverage run -m pytest
$ coverage report