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.
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
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)