indexOf
Returns the index of the element in the array, and returns-1. Similar to the IndexOf method of string.
If other browsers do not implement this method, you can implement compatibility with the following code:
Copy Code code as follows:
1. Do you really know the sort method in JavaScript?
2. Do you know the function body of the Localecompare method in JavaScript?
3. What are the parameters of the table sorting method?
The sort method in JavaScript directly provides the function of
Speaking of the branching structure in JavaScript, we have to mention the word Process control, all of our programs are made up of data and algorithms.
program = data + algorithm
Usually, the algorithm can be composed of "order", "branch", "loop"
Before learning the variable scope of JavaScript, we should be clear on a few points:
A, JavaScript's variable scope is based on its specific scope chain.
b, JavaScript does not have block-level scopes.
C, variables declared in a function are
Such. There's a problem here, for example, in a line in the code, I would like to use a declared variable x, the result of typing or spelling errors, the variable is written y, the result is equivalent to "implicit" declared a variable y, in the
IE there is still a sharp weapon has not been used, that is VML. Although not as SVG, it is still very powerful. On the implementation gradient, its fill is much more powerful than IE's gragient filter. But VML appeared earlier, supporting only a
One, what are the types and usage of closures and closures &NBSP 1, what is a closure closure, The official explanation for closures is that an expression (usually a function) with many
1, what is closure
Closures are functions that have access to variables that are scoped to another function.Simply put, JavaScript allows the use of intrinsic functions---i.e. function definitions and function expressions in the function body of
Here does not carry on the very complex background verification as well as the JavaScript regular expression, simply introduces this technique, the simple backstage receives with jumps, probably understands how verifies can. Specific technology, I
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Note: In IE, you need to change the "Maximum number of script steps" for IE in this test:
[HKEY_CURRENT_USER\Software\Microsoft\Internet
0-Determine whether the variable, parameter initialization
if (x) {}//variable is initialized or the variable is not empty or the variable is not zero
1-The Declaration function does not need to declare the return value, the parameter
JavaScript is not an object-oriented language and does not provide a traditional way of inheriting, but it provides a way of prototyping inheritance, using the prototype properties provided by itself to implement inheritance.
The prototype chain is
There are many reasons why you can add a drag-and-drop function to your page, the simplest reason being to rearrange the data. For example, you might want users to be able to reorganize a series of page elements by placing an input or select
This article illustrates the concept and usage of JavaScript function throttling. Share to everyone for your reference, specific as follows:
Recently in the Web page when there is a need, is the browser window changes need to change some of the
The main use of the Location object, containing information about the current URL, is a part of the Window object that can be accessed through the Window.location property.
Method One (Window.document.location.href/window.document.location.pathname)
A case of analog click in general two aspects, analog Click on the Super Connection eventFirefox's compatible functions areAdd onclick event to Htmlanchorelement
Copy Code code as follows:
try {
Create a element so this
Create a random number
① since JavaScript, many browsers have built-in random number generation methods. For example:
var number = Math.random ();
This method produces a floating-point number between 0 and 1.
② is based on time and can also produce
One, what is an anonymous function?
There are generally three ways to define a function in javascript:
functions keyword (function) statement :function fnMethodName(x){alert(x);}
functions literal (function literals):var fnMethodName
Today, preview the results of tonight, as follows (a little bit, don't throw bricks):
Today, the main design of the next selector, is to enter the game to show the list of games, and then used to select the game of an idiot's function.
The
Just learned the operation methods and properties of the DOM node tree, while trying to write a not manually set the ID and double-click the event example, toss the n long time finally made a touch of the sample, the code is as follows: (Note:
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