Skip to content
Myr

README.rst

This file

Path

examples/javascript/README.rst

48 lines · 1.1 KiB

Last changed by

examples/javascript: replace obsolete link (#5287)Iztok Fister Jrbefore adoption541bc8d

History of this file

Take it

The walk stopped after 200 commits: lines older than 604de4b point at it.

Merge branch '2.2.x'David Lordbefore adoption604de4b

lines 1–17why, one step back
1JavaScript Ajax Example
2=======================34Demonstrates how to post form data and process a JSON response using5JavaScript. This allows making requests without navigating away from the6page. Demonstrates using |fetch|_, |XMLHttpRequest|_, and7|jQuery.ajax|_. See the `Flask docs`_ about JavaScript and Ajax.89.. |fetch| replace:: ``fetch``10.. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch1112.. |XMLHttpRequest| replace:: ``XMLHttpRequest``13.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest1415.. |jQuery.ajax| replace:: ``jQuery.ajax``16.. _jQuery.ajax: https://api.jquery.com/jQuery.ajax/17

examples/javascript: replace obsolete link (#5287)Iztok Fister Jrbefore adoption541bc8d

line 18why, one step back
18.. _Flask docs: https://flask.palletsprojects.com/patterns/javascript/

Merge branch '2.2.x'David Lordbefore adoption604de4b

lines 19–48why, one step back
19
2021Install22-------2324.. code-block:: text2526 $ python3 -m venv .venv27 $ . .venv/bin/activate28 $ pip install -e .293031Run32---3334.. code-block:: text3536 $ flask --app js_example run3738Open http://127.0.0.1:5000 in a browser.394041Test42----4344.. code-block:: text4546 $ pip install -e '.[test]'47 $ coverage run -m pytest48 $ coverage report