JavaScript composition, Introduction, output, operator basics explain _javascript skills

Source: Internet
Author: User
Tags numeric value object model

JavaScript Introduction:

JavaScript is a scripting language that belongs to the web!

JavaScript is used by millions of of pages to improve design, validate forms, detect browsers, create cookies, and apply more.

JavaScript is the most popular scripting language on the Internet.

The following focuses on the composition of JS, Introduction, Output, operator basics, specific details are as follows:

JavaScript composition:

ECMAscript

Browser Object Model BOM

Document Object Model DOM

ECMAScript BOM Dom

The DOM (Document Object model) is used to access and manipulate HTML documents

BOM (Browser object model)

JS is the browser language

JavaScript Introduction:

1 <script src= "Xxx.js" > </script>

2 Introduction of external files

3 Inside tags use attributes to write JavaScript code

Encoding Format UTF-8

Alert ("")
document.write ("")

Double quotes what you want to display is a double quote number, which is a numeric value without double quotes.

Single quote double quotes alternately used in pair appearance

<a href= "Javascript:alert (' China ');" > Stand-alone </a>

You can't have double quotes in China. Will cause a conflict with the preceding double quotes

Single-line Comment/**/multiple-line Comment

Variables let the computer record (store) a data that is stored in a value

Cannot add a number before a variable name

= equals Sign represents assignment

Want to have the character string store double quotes

Double quotes are character/string types

sum+=10 equal to Sum=sum+10

++y first after the operation Y++ first participate in the operation and then add

+ Number has link action and add action

x=“110” d .w(x + 10) 输出 11010
x= 110 d.w(x+10) 输出 120

var x = "the";
x = parseint (x);//x=110
document.write (x+10);

d.w(x) 输出120

var y=8;

document.write (y+ "" +10) result 810 empty characters also provide the opportunity of word linked,

Operator

Relational operator method > < >= <=!= = = = = = = =

Indicates a relationship produces a Boolean type result meaning: Ask the computer if it's right or wrong.

Logical operator && has false on false | | There's ture, ture.

&& | | Short-circuit operators if the first condition of comparison can end the comparison, then no comparison is performed.

Related Article

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.