HTML script
HTML script
HTML <script> tag
<script> tag is used to define client-side scripts, such as JavaScript. The
<script> element can contain script statements or point to an external script file through the src attribute.
JavaScript is most commonly used for image manipulation, form validation, and dynamic content updating.
Example:
<script> document.write("好好学习") </script>
HTML<noscript> tag
<noscript> tag provides alternative content when scripts cannot be used, such as in the browser When scripting is disabled, or the browser does not support client-side scripting. The
<noscript> element can contain all elements found within the body element of a normal HTML page.
The content in the <noscript> element will only be displayed if the browser does not support scripts or has scripts disabled:
Example
<script> document.write("Hello World!") </script> <noscript>抱歉,你的浏览器不支持 JavaScript!</noscript>
To cope with old-fashioned browsing Browser
Edit
If the browser cannot recognize the <script> tag at all, then the content contained in the <script> tag will be displayed on the page as text. To avoid this happening, you should hide your scripts in comment tags. Older browsers (browsers that do not recognize the <script> tag) will ignore these comments and therefore will not display the content of the tag on the page. And those new browsers will understand these scripts and execute them, even if the code is nested within comment tags.
JavaScript:
<script type="text/javascript"> <!-- document.write("百度百科") //--> </script>
VBScript:
<script type="text/vbscript"><!--document.write("百度百科")'--></script>