zoukankan      html  css  js  c++  java
  • 3 ways of including JavaScript in HTML

    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
     
     
     
  • 相关阅读:
    UOJ309 UNR #2 排兵布阵
    BZOJ4860: [Beijing2017]树的难题
    CQOI2017 部分题解
    SDOI2017 Round1 Day2 题解
    记SCOI2017
    BZOJ3810: [Coci2015]Stanovi
    BZOJ4785: [Zjoi2017]树状数组
    「ZJOI2007」「LuoguP1169」棋盘制作(并查集
    「LuoguP4147」 玉蟾宫(并查集
    「LuoguP1402」 酒店之王(最大流
  • 原文地址:https://www.cnblogs.com/beyond-Acm/p/4794169.html
Copyright © 2011-2022 走看看