README.rst
This file
Path
examples/javascript/README.rst
48 lines · 1.1 KiB
Last changed by
Merge pull request #4947 from pallets/pyprojectDavid Lordbefore adoption78b42b9
History of this fileTake it
The walk stopped after 200 commits: lines older than 0fb5c2f point at it.
Merge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 1–5why, one step back1JavaScript Ajax Example2=======================34Demonstrates how to post form data and process a JSON response using5JavaScript. This allows making requests without navigating away from theMerge branch '2.1.x'David Lordbefore adoptiondcd1a1e
lines 6–7why, one step back6page. Demonstrates using |fetch|_, |XMLHttpRequest|_, and7|jQuery.ajax|_. See the `Flask docs`_ about JavaScript and Ajax.Merge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 8–11why, one step back89.. |fetch| replace:: ``fetch``10.. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch11Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e
lines 12–14why, one step back12.. |XMLHttpRequest| replace:: ``XMLHttpRequest``13.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest14Merge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 15–23why, one step back15.. |jQuery.ajax| replace:: ``jQuery.ajax``16.. _jQuery.ajax: https://api.jquery.com/jQuery.ajax/1718.. _Flask docs: https://flask.palletsprojects.com/patterns/jquery/192021Install22-------23Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e
line 24why, one step back24.. code-block:: textMerge branch '2.0.x'David Lordbefore adoption0fb5c2f
line 25why, one step back25Merge pull request #4947 from pallets/pyprojectDavid Lordbefore adoption78b42b9
lines 26–27why, one step back26 $ python3 -m venv .venv27 $ . .venv/bin/activateMerge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 28–33why, one step back28 $ pip install -e .293031Run32---33Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e
line 34why, one step back34.. code-block:: textMerge branch '2.0.x'David Lordbefore adoption0fb5c2f
line 35why, one step back35Merge pull request #4646 from pallets/cli-app-envDavid Lordbefore adoptionae54727
line 36why, one step back36 $ flask --app js_example runMerge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 37–43why, one step back3738Open http://127.0.0.1:5000 in a browser.394041Test42----43Merge branch '2.1.x'David Lordbefore adoptiondcd1a1e
line 44why, one step back44.. code-block:: textMerge branch '2.0.x'David Lordbefore adoption0fb5c2f
lines 45–48why, one step back4546 $ pip install -e '.[test]'47 $ coverage run -m pytest48 $ coverage report