This method creates an HTML anchor that is used as a hypertext target.Grammar
String.anchor (Anchorname)
The following are the details of the parameters:
Anchorname: Defines the name of the anchor
return value:
String that
This method returns the character in a string at the specified position by the specified number of characters.Grammar
String.substr (start[, length]);
The following are the details of the parameters:
Start: Extract character at
This method is used when matching a string that matches a regular expression to retrieve a match.Grammar
String.match (param)
The following are the details of the parameters:
Param: Regular Expression object
return value:
If the
This method converts two or more strings and returns a new single string.Grammar
String.Concat (string2, string3[, ..., stringn]);
The following are the details of the parameters:
STRING2...STRINGN: These are the strings to be
This method returns the character from the specified index.
The characters in the string are indexed from left to right. The index of the first character is 0, and the index of the last character in a named Stringname string is
JavaScript1.2 introduces the concept of function text as a new method of defining functions.
The function text is an expression that defines a nameless function.Grammar
The syntax of a literal function is very similar to a function declaration,
This is another loop that JavaScript supports. It is called the for...in loop. This loop is the property used to loop through an object.
Because we have not discussed the object, so using this loop may not feel quite clear. However, once you've
Starting with the Magic "$" function
The "$" function binds the event for a specified button after the document is loaded, and the code works fine on a single web page. But if we have other pages, we will have to repeat the process.
Copy Code
Looking at discuz! Source, found a section of browser validation code, or more classic:
Copy Code code as follows:
var BROWSER = {};
var useragent = Navigator.userAgent.toLowerCase ();
alert (useragent);
browser.ie = window.
It's enough to have this picture, simply to explain
In height, for example, width is the same:
Div.clientheight: The visible window removes the length after margin+border.
Div.offsetheight: The length of the border and scrollbars are added on
HTML Section Code:
Copy Code code as follows:
change background color when mouse passes
change background color when mouse passes
change background color when mouse passes
change background color when mouse passes
HTML Section Code:
When the show button is clicked, the Showvalue function is triggered to dynamically add the value of input value to the element node of id= "text"!
Copy Code code as follows:
"
JavaScript Part
JavaScript implements the picture switch, mainly uses the setinterval () function and the clearinterval () function, the former function is turns on the animation, the latter function is clears the animation (may understand for the animation to stop)
Auto-matching technology: in simple terms, "according to user input information to prompt some similar items for users to choose." has a very wide range of applications, such as our most commonly used Baidu, when the input of some search content
For example, now there is an operation a->b->c->b the return key on page B returns the first time C if you want to return directly to A or somewhere else you need to trigger the return event.
Pushhistory ();
Window.addeventlistener
When using JavaScript, it is sometimes too familiar with the methods that are often used and ignores the nuances of their principles.
Examples are as follows:
Window.location.href,window.location.replace.
Both of these ways let the page jump to a
Through an example to understand the specific difference between arguments and Arguments.callee:
The code is as follows:
Copy Code code as follows:
Call Method:
Copy Code code as follows:
The results after
Event bindings fall into two categories:
One is the traditional event binding (inline model/script model), the previous chapter content;One is the modern event binding (DOM2 level model); Modern event binding provides more powerful functions on the
Objective
In this chapter, we will explain the 5th of the implementation of the S.o.l.i.d Five Principles JavaScript language, which relies on the inverted principle LSP (the Dependency inversion principle).
Original English:
/*** Page-Class construction* Parameter ntotallist: Total number of bars* Parameter npagesize: Show the number of bars per page* Parameter Npagenum: current page number* parameter spageurl: The URL of the paging link, the page number is replaced
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