Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phpjsnerd/flask-javascript
Flask Javascript AJAX Example Using XMLHttpRequest, Fetch & JQuery.ajax
https://github.com/phpjsnerd/flask-javascript
fetch flask javascript jquery python rest
Last synced: 23 days ago
JSON representation
Flask Javascript AJAX Example Using XMLHttpRequest, Fetch & JQuery.ajax
- Host: GitHub
- URL: https://github.com/phpjsnerd/flask-javascript
- Owner: phpjsnerd
- License: other
- Created: 2018-09-13T06:32:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T08:09:56.000Z (over 6 years ago)
- Last Synced: 2024-11-18T20:58:46.013Z (3 months ago)
- Topics: fetch, flask, javascript, jquery, python, rest
- Language: HTML
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
JavaScript Ajax Example
=======================.. image:: https://api.codacy.com/project/badge/Grade/45dec1a1afbb4f62a1557160a07d280e
:alt: Codacy Badge
:target: https://app.codacy.com/app/phpjsnerd/flask-javascript?utm_source=github.com&utm_medium=referral&utm_content=phpjsnerd/flask-javascript&utm_campaign=Badge_Grade_SettingsDemonstrates how to post form data and process a JSON response using
JavaScript. This allows making requests without navigating away from the
page. Demonstrates using |XMLHttpRequest|_, |fetch|_, and
|jQuery.ajax|_. See the `Flask docs`_ about jQuery and Ajax... |XMLHttpRequest| replace:: ``XMLHttpRequest``
.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest.. |fetch| replace:: ``fetch``
.. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch.. |jQuery.ajax| replace:: ``jQuery.ajax``
.. _jQuery.ajax: https://api.jquery.com/jQuery.ajax/.. _Flask docs: http://flask.pocoo.org/docs/patterns/jquery/
Install
-------::
python3 -m venv venv
. venv/bin/activate
pip install -e .Run
---::
export FLASK_APP=js_example
flask runOpen http://127.0.0.1:5000 in a browser.
Test
----::
pip install -e '.[test]'
coverage run -m pytest
coverage report