summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/_theme/djangodocs/layout.html4
-rw-r--r--docs/ref/contrib/admin/javascript.txt4
-rw-r--r--docs/ref/csrf.txt2
-rw-r--r--docs/topics/forms/media.txt54
-rw-r--r--docs/topics/i18n/translation.txt2
5 files changed, 33 insertions, 33 deletions
diff --git a/docs/_theme/djangodocs/layout.html b/docs/_theme/djangodocs/layout.html
index acf83a47cd..c8770173aa 100644
--- a/docs/_theme/djangodocs/layout.html
+++ b/docs/_theme/djangodocs/layout.html
@@ -21,8 +21,8 @@
{# as it causes problems in compiled CHM files. #}
{% if builder != "htmlhelp" %}
{{ super() }}
-<script type="text/javascript" src="{{ pathto('templatebuiltins.js', 1) }}"></script>
-<script type="text/javascript">
+<script src="{{ pathto('templatebuiltins.js', 1) }}"></script>
+<script>
(function($) {
if (!django_template_builtins) {
// templatebuiltins.js missing, do nothing.
diff --git a/docs/ref/contrib/admin/javascript.txt b/docs/ref/contrib/admin/javascript.txt
index 089ef0e618..05731c57b0 100644
--- a/docs/ref/contrib/admin/javascript.txt
+++ b/docs/ref/contrib/admin/javascript.txt
@@ -28,7 +28,7 @@ In your custom ``change_form.html`` template, extend the
{% block admin_change_form_document_ready %}
{{ block.super }}
- <script type="text/javascript" src="{% static 'app/formset_handlers.js' %}"></script>
+ <script src="{% static 'app/formset_handlers.js' %}"></script>
{% endblock %}
.. code-block:: javascript
@@ -66,7 +66,7 @@ listen to the event triggered from there. For example:
{% block admin_change_form_document_ready %}
{{ block.super }}
- <script type="text/javascript" src="{% static 'app/unregistered_handlers.js' %}"></script>
+ <script src="{% static 'app/unregistered_handlers.js' %}"></script>
{% endblock %}
.. code-block:: javascript
diff --git a/docs/ref/csrf.txt b/docs/ref/csrf.txt
index ee6d0643fe..94bf447aab 100644
--- a/docs/ref/csrf.txt
+++ b/docs/ref/csrf.txt
@@ -136,7 +136,7 @@ and read the token from the DOM with JavaScript:
.. code-block:: html+django
{% csrf_token %}
- <script type="text/javascript">
+ <script>
// using jQuery
var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
</script>
diff --git a/docs/topics/forms/media.txt b/docs/topics/forms/media.txt
index c88679dda6..d12b66fe6e 100644
--- a/docs/topics/forms/media.txt
+++ b/docs/topics/forms/media.txt
@@ -72,8 +72,8 @@ can be retrieved through this property::
>>> w = CalendarWidget()
>>> print(w.media)
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
Here's a list of all possible ``Media`` options. There are no required options.
@@ -147,9 +147,9 @@ example above::
>>> print(w.media)
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
<link href="http://static.example.com/fancy.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
- <script type="text/javascript" src="http://static.example.com/whizbang.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/whizbang.js"></script>
The FancyCalendar widget inherits all the assets from its parent
widget. If you don't want ``Media`` to be inherited in this way, add
@@ -166,7 +166,7 @@ an ``extend=False`` declaration to the ``Media`` declaration::
>>> w = FancyCalendarWidget()
>>> print(w.media)
<link href="http://static.example.com/fancy.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/whizbang.js"></script>
+ <script src="http://static.example.com/whizbang.js"></script>
If you require even more control over inheritance, define your assets using a
:ref:`dynamic property <dynamic-property>`. Dynamic properties give you
@@ -229,16 +229,16 @@ was ``None``::
>>> w = CalendarWidget()
>>> print(w.media)
<link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://uploads.example.com/animations.js"></script>
- <script type="text/javascript" src="http://othersite.com/actions.js"></script>
+ <script src="http://uploads.example.com/animations.js"></script>
+ <script src="http://othersite.com/actions.js"></script>
But if :setting:`STATIC_URL` is ``'http://static.example.com/'``::
>>> w = CalendarWidget()
>>> print(w.media)
<link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://othersite.com/actions.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://othersite.com/actions.js"></script>
Or if :mod:`~django.contrib.staticfiles` is configured using the
:class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`::
@@ -246,8 +246,8 @@ Or if :mod:`~django.contrib.staticfiles` is configured using the
>>> w = CalendarWidget()
>>> print(w.media)
<link href="/css/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="https://static.example.com/animations.27e20196a850.js"></script>
- <script type="text/javascript" src="http://othersite.com/actions.js"></script>
+ <script src="https://static.example.com/animations.27e20196a850.js"></script>
+ <script src="http://othersite.com/actions.js"></script>
``Media`` objects
=================
@@ -269,8 +269,8 @@ operator to filter out a medium of interest. For example::
>>> w = CalendarWidget()
>>> print(w.media)
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
>>> print(w.media['css'])
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
@@ -301,9 +301,9 @@ specified by both::
>>> w2 = OtherWidget()
>>> print(w1.media + w2.media)
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
- <script type="text/javascript" src="http://static.example.com/whizbang.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/whizbang.js"></script>
.. _form-media-asset-order:
@@ -327,10 +327,10 @@ For example::
>>> w1 = CalendarWidget()
>>> w2 = TimeWidget()
>>> print(w1.media + w2.media)
- <script type="text/javascript" src="http://static.example.com/jQuery.js"></script>
- <script type="text/javascript" src="http://static.example.com/calendar.js"></script>
- <script type="text/javascript" src="http://static.example.com/time.js"></script>
- <script type="text/javascript" src="http://static.example.com/noConflict.js"></script>
+ <script src="http://static.example.com/jQuery.js"></script>
+ <script src="http://static.example.com/calendar.js"></script>
+ <script src="http://static.example.com/time.js"></script>
+ <script src="http://static.example.com/noConflict.js"></script>
Combining ``Media`` objects with assets in a conflicting order results in a
``MediaOrderConflictWarning``.
@@ -357,9 +357,9 @@ are part of the form::
>>> f = ContactForm()
>>> f.media
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
- <script type="text/javascript" src="http://static.example.com/whizbang.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/whizbang.js"></script>
If you want to associate additional assets with a form -- for example,
CSS for form layout -- add a ``Media`` declaration to the form::
@@ -377,6 +377,6 @@ CSS for form layout -- add a ``Media`` declaration to the form::
>>> f.media
<link href="http://static.example.com/pretty.css" type="text/css" media="all" rel="stylesheet">
<link href="http://static.example.com/layout.css" type="text/css" media="all" rel="stylesheet">
- <script type="text/javascript" src="http://static.example.com/animations.js"></script>
- <script type="text/javascript" src="http://static.example.com/actions.js"></script>
- <script type="text/javascript" src="http://static.example.com/whizbang.js"></script>
+ <script src="http://static.example.com/animations.js"></script>
+ <script src="http://static.example.com/actions.js"></script>
+ <script src="http://static.example.com/whizbang.js"></script>
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index f9bb27b6b7..7a8be1eb4a 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -1052,7 +1052,7 @@ To use the catalog, pull in the dynamically generated script like this:
.. code-block:: html+django
- <script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
+ <script src="{% url 'javascript-catalog' %}"></script>
This uses reverse URL lookup to find the URL of the JavaScript catalog view.
When the catalog is loaded, your JavaScript code can use the following methods: