JavaScript Basic Grooming (i)

Source: Internet
Author: User
Tags script tag

First look at what is Javascript,javascript is Object-based and event-driven and has a relatively secure scripting language that is widely used for client Web development, and is a widely used scripting language for Web client development.

    • JavaScript composition

BOM (Browser object model): Browser object models, describing methods and interfaces for interacting with browsers

DOM: Document Object model, method and interface for describing Web page content

ECMAScript: Manipulating the DOM and BOM

    • JavaScript features

Explanatory type

Line-by-row execution of an error subsequent code all does not execute

Weak type

With so much theoretical knowledge, here's a look at how and where JavaScript is introduced

The first script tag (internal introduction) can be placed anywhere, but is recommended at the bottom of the body (loading HTML and CSS code, loading JS code)

The second script tag is introduced (that is, externally introduced), JS code is placed in a separate JS folder

Watch out! What to do if two ways are used together, with external introduction as the main, internal script tag in the code is all void

<!DOCTYPE HTML><HTML>    <Head>           <MetaCharSet= "UTF-8">        <title></title>        <styletype= "Text/css">            /*here is the CSS code*/        </style>            </Head>    <Body>/ * Write HTML code here * /<Script>/*The first kind of internal introduction*/             /*JS Code*/         </Script>         <Scriptsrc= "path">/*The second kind of external introduction*/                   /*JS Code*/         </Script>        </Body></HTML>

Three methods of debugging

alter ("Can be Chinese and English")//pop-up warning box (less used)

document.write ("")//page output (will overwrite other content in body)

Console.log ("")//in console output press F12, then click Console (Common)

two modes of output

See the above output, yes, the two output is document.write and Console.log

Three types of frames

Alter ()

Prompt (hint message, default)//Popup Output box

Confirm ()//OK Cancel bullet box, OK return True, Cancel return False

JavaScript Basic Grooming (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.