What is the difference in different ways of defining a script?
The ways I'm talking about are
<script>....</script>
<script language="javascript">.....</script>
<script type="text/javascript">...........</script>
So how do they all do the same thing as the other?
According to the w3c spec , an attribute is required typeand defines the script language, while an attribute language(which does more or less the same) is deprecated in favor type, so you should use the attribute type.
type
language
<script language="javascript">
HTML 3.2 First Attempt
<script type="text/javascript">
HTML 4.x and XHTML 1.x - using MIME types for everything. This is the current standard. Use this.
<script>
HTML 5 () - ", , , , "
HTML 4.01 . http://www.w3.org/TR/REC-html40/interact/scripts.html#adef-type-SCRIPT
/javascript, , IE. HTML5 . http://www.whatwg.org/specs/web-apps/current-work/#attr-script-type
Source: https://habr.com/ru/post/1751869/More articles:Just graduated from the basics of reverse engineering. How to move forward? - assemblyHow to fire marker dragend event in google maps v3? - eventsIs there a tool for TFS that quickly scans the author of a single line code? - visual-studio-2010How can I programmatically control the start and stop of Selenium RC - seleniumWhat fonts support a large number of weights? / How to fake a font-weight? - designFind the longest path between any two nodes - javaHow to create a linked list of nodes that are contained in the maximum depth of a binary tree using Java - javaError passing * as shell argument in C - cDynamicJasper: how to delete a line when empty - javaCan I change the Android style in ListView style without creating a custom list? - androidAll Articles