博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
3 ways of including JavaScript in HTML
阅读量:6154 次
发布时间:2019-06-21

本文共 1283 字,大约阅读时间需要 4 分钟。

Code written in JavaScript must be executed from a document written in HTML.
There are three ways of doing this :
1. you can place the JavaScript between <script> tags within the <head> of the document :
2. a much better technique is to place your JavaScript code into a separate file. 
 
3. the best way is to place the <script> tag at the end of the document right before the closing 
</body> tag :
 
 
Placing the <script> tag at the end of the document lets the browser load the page faster. 

Programming languages are either interpreted or compiled. Languages like Java or C++ require a
compiler. A compiler is a program that translates the source code written in a high-level language like Java into a file that can be executed directly by a computer.
 
Interpreted languages dont require a complier -- they just need an interpreter instead.
With JavaScript, in the context of the World Wide Web, the web browser does the interpreting.

Without the interpreter, the JavaScript code would never be executed.

 
If there are any errors in the code written in a compiled language, those errors will pop up when the code is compiled. In the case of an interpreted language, errors won’t become apparent until the interpreter executes the code
 
 
 

转载于:https://www.cnblogs.com/beyond-Acm/p/4794169.html

你可能感兴趣的文章
Dijkstra算法
查看>>
css 动画 和 响应式布局和兼容性
查看>>
csrf 跨站请求伪造相关以及django的中间件
查看>>
MySQL数据类型--与MySQL零距离接触2-11MySQL自动编号
查看>>
生日小助手源码运行的步骤
查看>>
Configuration python CGI in XAMPP in win-7
查看>>
bzoj 5006(洛谷 4547) [THUWC2017]Bipartite 随机二分图——期望DP
查看>>
CF 888E Maximum Subsequence——折半搜索
查看>>
欧几里德算法(辗转相除法)
查看>>
面试题1-----SVM和LR的异同
查看>>
MFC控件的SubclassDlgItem
查看>>
如何避免历史回退到登录页面
查看>>
《图解HTTP》1~53Page Web网络基础 HTTP协议 HTTP报文内的HTTP信息
查看>>
unix环境高级编程-高级IO(2)
查看>>
树莓派是如何免疫 Meltdown 和 Spectre 漏洞的
查看>>
雅虎瓦片地图切片问题
查看>>
HTML 邮件链接,超链接发邮件
查看>>
HDU 5524:Subtrees
查看>>
手机端userAgent
查看>>
pip安装Mysql-python报错EnvironmentError: mysql_config not found
查看>>