Skip to content
Myr

README.rst

This file

Path

examples/javascript/README.rst

49 lines · 1.0 KiB

Last changed by

Merge pull request #3427 from greyli/update-old-linksDavid Lordbefore adoption25a5d30

History of this file

Take it

The walk stopped after 200 commits: lines older than 1351d0a point at it.

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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 |XMLHttpRequest|_, |fetch|_, and7|jQuery.ajax|_. See the `Flask docs`_ about jQuery and Ajax.89.. |XMLHttpRequest| replace:: ``XMLHttpRequest``10.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest1112.. |fetch| replace:: ``fetch``13.. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch1415.. |jQuery.ajax| replace:: ``jQuery.ajax``16.. _jQuery.ajax: https://api.jquery.com/jQuery.ajax/17

Merge pull request #3427 from greyli/update-old-linksDavid Lordbefore adoption25a5d30

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

Merge branch '1.0.x'David Lordbefore adoption1351d0a

lines 19–49why, one step back
19
2021Install22-------2324::2526 $ python3 -m venv venv27 $ . venv/bin/activate28 $ pip install -e .293031Run32---3334::3536 $ export FLASK_APP=js_example37 $ flask run3839Open http://127.0.0.1:5000 in a browser.404142Test43----4445::4647 $ pip install -e '.[test]'48 $ coverage run -m pytest49 $ coverage report