2018/1/1 Html+css+javascript

Source: Internet
Author: User

1, the role of the head information
Can the title of the page tittle
Search keywords: keywords
Page Description: Description
Page Jump: HTTP-EQIP
2, CSS style import @import, actually equivalent to inline, but the priority is the worst,
3. Tag Selector P
Class selector.
ID selector #IdValue
Global Selector *
The combo selector lists the previous
Pseudo-class selectors are used to determine the status of a label
4, using the prototype property in JavaScript to achieve inheritance;
5. JavaScript:
(1) Object-based
JS itself has some ready-made objects for programmers to use, for example: array,math,string ...
JS does not rule out that you can create objects from a certain rule
(2) Event-driven
After the JS code is written, it needs to be triggered before it can be run, for example: Click event, timed execution, ...
(3) Explanatory
Each time you run the JS code, you need to interpret the original line of code one line of the execution
Relatively slow execution relative to compiled languages (for example: Java, C + +)
(4) browser-based Dynamic interactive Web page technology
If JS is embedded in HTML, it can be interpreted directly by the browser without the need for server support.
If JS is embedded in a JSP or servlet, server support is required and is interpreted directly by the browser
(5) embedded in HTML tags
JS must be embedded in a label called <script src= "introduce external JS file" ></script> to run
scripting language
6, JS in three kinds of
(1) Basic type: Number,string,boolean
Number contains positive number, negative number, decimal number
String by "or" "Bound
Boolean is either True or FALSE, but the Boolean in JS also contains more cases, for example: presence indicates true, there is no representation false
(2) Special type: null,undefined
Null indicates that a variable is pointing to null
Undefined indicates that a variable points to a value that is not deterministic
(3) Composite type: Function, object, array
object contains built-in objects and custom objects
7. There are three ways to define functions in JS
(1) Normal mode: function MySum (num1,num2) {return num1+num2;}
function MySum (num1,num2) {
return NUM1 + num2;
}
var myresult = mysum (100,200);
Alert ("myresult=" +myresult);

(2) constructor mode: New Function ("Num1", "num2", "return num1+num2;")
var youresult = new Function ("Num1", "num2", "return num1+num2");
Alert (Youresult (1000,2000));

(3) Direct volume or anonymous or nameless way: var mysum = function (num1,num2) {return num1+num2;}
var theyresult = function (num1,num2) {
return NUM1 + num2;
}
Alert (Theyresult (10000,20000));
8,) JS has four kinds of objects
(1) Built-in object: Date,math,string,array, ...
var str = new Date (). toLocaleString ();
Window.document.write ("<font size= ' color= ' Red ' >" +str+ "</font>");

(2) Custom object: Person,card, ...
function Student (id,name,sal) {
This points to the S reference
This.id = ID;
THIS.name = name;
This.sal = sal;
}
var s = new Student (1, "Bobo", 7000);
document.write ("Number:" + s.id + "<br/>");
document.write ("Name:" + s.name + "<br/>");
document.write ("Salary:" + s.sal + "<br/>");

(3) Browser object: Window,document,status,location,history ...
function Myrefresh () {
Window.history.go (0);
}

(4) ActiveX object: ActiveXObject ("Microsoft.XMLHTTP"), ...

9. BOM Programming Basics
The full name Browser object model, the browser objects.
JavaScript is a JavaScript script interpreter that is built into the browser to execute the JavaScript scripting language.
In order to facilitate the operation of the browser, JavaScript encapsulates the browser's various objects so that developers can easily manipulate the browser.
10. Introduction to DOM
The full name Document Object model, which is the documentation objects.
The DOM depicts a hierarchical tree that allows developers to add, delete, and modify portions of a page.

When the browser parses the HTML page markup, it is not actually read and parsed in one line.
Instead, each tag in the HTML page is sequentially assembled in memory with a DOM tree,
After it is formed, the page is displayed in the browser's window according to the tree's structure.

2018/1/1 Html+css+javascript

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.