A friend who is learning javascript can take it as a small exercise. Enhance your coding capability.
Reference code:Copy codeThe Code is as follows: ggggg Figure:
Copy codeThe Code is as follows:1. Simple filter selector: matches elements according to certain filtering rules and starts with a colon (:) in writing. Simple filter selector is the most widely used filter selector.JQuery selector detailsBased on
In the background management of a blog, you can add an address for a category, but it is difficult to add an onclick event. If you want to pass the current object to a function, you can write the URL as "Javascript: shoControlSidebar (this)".
Generally, two methods can be used to dynamically create elements.1. Dom HTmlCopy codeThe Code is as follows:Var select = document. createElement ("select ");Select. options [0] = new Option ("add-on 1", "value1 ");Select. options [1] = new Option ("
I have heard that Firefox's JS engine supports the for each in syntax, such as the following code:Copy codeThe Code is as follows:Var arr = [10, 20, 30, 40, 50];For each (var k in arr)Console. log (k );You can directly traverse the content of the
Usage:Copy codeThe Code is as follows:Str. substring (start, end)"String Literal". substring (start, end) "Start" indicates the starting position of the string to be truncated. The index starts from 0."End" indicates the end position of the string
Sublime TextIt is a very good cross-platform editor with beautiful user interfaces and powerful functions, such as code thumbnails, multiple choices, and quick commands. You can also customize Key Binding, menus, and toolbar. Sublime Text provides
1. Open the link on the entire webpage in a new window: add the link to the head2. Open all links in a DIV in a new window:Add in bodyCopy codeThe Code is as follows: Added whether or not to open the current windowCopy codeThe Code is as follows://
When using Javascript to declare variables, although the var keyword is used to declare the variables and the keyword is not used to declare the variables, it is not a problem to run in many cases, but the two methods are different. Code that can
An example of the H7N9 infection distribution chart generated using Baidu map JSAPI. The data is from xinhuanet (No. 4.8), as shown below:The list of functions used is as follows:1. Customize the copyright control function, that is, (1) the
1. It indicates that when extjs is used, it is relatively slow to run, especially when there are too many running data and js, it may become stuck or wait for a long time.There are many optimization methods to solve this problem. One of them today
When the user enters the pwd password 123, the page jumps to the second page. After 4 seconds, the page automatically jumps to the third page.Login.htmlCopy codeThe Code is as follows:U: P: OK .htmlCopy codeThe Code is as follows:Log On 5
JQuery provides two functions:
1. $. map (array, callback (element, index ));
For each element in the array, call the callback () function and return a new array. The original array remains unchanged.
For example:
$ (Function (){Var arrInt = [1, 3, 5
Although many languages claim that "Everything is an object", not all values in javascript are objects.
Original Value vs objectValues in javascript can be divided into two categories: original values and objects ).
DefinitionThe two types of
I. Element nodesCopy codeThe Code is as follows:// Test the element node, output node name, node type, and node ValueVar liElements = document. getElementsByTagName ("li ");For (var I = 0; I Alert (liElements [I]. nodeName );Alert (liElements [I].
Let's use examples to illustrate several methods of setTimeout in jQuery. First, we have prepared the DIV and public functions used for testing:
Copy codeThe Code is as follows: The basic usage of setTimeout in the original javascript is like
1. jump out of the framework and go to the parent page.Jsp:Copy codeThe Code is as follows: Java:Copy codeThe Code is as follows:PrintWriter out = response. getWriter ();Out. write (" ");Return; 2. jump from a framework to the framework named name =
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