README.rst
This file
Path
examples/javascript/README.rst
49 lines · 1.1 KiB
Last changed by
Merge pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
History of this fileTake it
The walk stopped after 200 commits: lines older than 11798fd point at it.
[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
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 pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
lines 6–7why, one step back6page. Demonstrates using |fetch|_, |XMLHttpRequest|_, and7|jQuery.ajax|_. See the `Flask docs`_ about JavaScript and Ajax.[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
lines 8–11why, one step back89.. |fetch| replace:: ``fetch``10.. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch11Merge pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
lines 12–14why, one step back12.. |XMLHttpRequest| replace:: ``XMLHttpRequest``13.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest14[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
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 pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
line 24why, one step back24.. code-block:: text[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
lines 25–33why, one step back2526 $ python3 -m venv venv27 $ . venv/bin/activate28 $ pip install -e .293031Run32---33Merge pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
line 34why, one step back34.. code-block:: text[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
lines 35–44why, one step back3536 $ export FLASK_APP=js_example37 $ flask run3839Open http://127.0.0.1:5000 in a browser.404142Test43----44Merge pull request #4636 from pallets/docs-javascriptDavid Lordbefore adoption9398630
line 45why, one step back45.. code-block:: text[pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]before adoption11798fd
lines 46–49why, one step back4647 $ pip install -e '.[test]'48 $ coverage run -m pytest49 $ coverage report