diff --git a/examples/javascript/README.rst b/examples/javascript/README.rst index b25bdb4e..b6e340df 100644 --- a/examples/javascript/README.rst +++ b/examples/javascript/README.rst @@ -3,15 +3,15 @@ JavaScript Ajax Example Demonstrates 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 +page. Demonstrates using |fetch|_, |XMLHttpRequest|_, and +|jQuery.ajax|_. See the `Flask docs`_ about JavaScript and Ajax. .. |fetch| replace:: ``fetch`` .. _fetch: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch +.. |XMLHttpRequest| replace:: ``XMLHttpRequest`` +.. _XMLHttpRequest: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest + .. |jQuery.ajax| replace:: ``jQuery.ajax`` .. _jQuery.ajax: https://api.jquery.com/jQuery.ajax/ @@ -21,7 +21,7 @@ page. Demonstrates using |XMLHttpRequest|_, |fetch|_, and Install ------- -:: +.. code-block:: text $ python3 -m venv venv $ . venv/bin/activate @@ -31,7 +31,7 @@ Install Run --- -:: +.. code-block:: text $ export FLASK_APP=js_example $ flask run @@ -42,7 +42,7 @@ Open http://127.0.0.1:5000 in a browser. Test ---- -:: +.. code-block:: text $ pip install -e '.[test]' $ coverage run -m pytest diff --git a/examples/javascript/js_example/templates/base.html b/examples/javascript/js_example/templates/base.html index 50ce0e9c..a4d35bd7 100644 --- a/examples/javascript/js_example/templates/base.html +++ b/examples/javascript/js_example/templates/base.html @@ -1,7 +1,7 @@
fetch
- is the new plain JavaScript way to make requests. It's
- supported in all modern browsers except IE, which requires a
- polyfill.
+ is the modern plain JavaScript way to make requests. It's
+ supported in all modern browsers.
{% endblock %}
{% block script %}
-
-