Copy Code code as follows:
Random number of
Max random number
Rebuild
Time consuming (ms):
Bubble sort
select sort
Insert Sort
Shea sort
Quick Sort (Recursive)
Quick sort (Stack)
Merge sort
Heap
Phpquery is a jquery-like Open-source project implemented in PHP that parses page elements in jquery syntax on the server side. Relative present or other ways to match the way the Web page, phpquery to use more convenient.
When using Phpquery to
JavaScript has the following conversion methods for data types:
one, converted into digital xxx*1.0Convert to String xxx+ ""
Two, extract the value of another type from one value and complete the conversion work.. extracts integers in a string:
When you get the sibling element of the specified element, you can use the adjacent sibling combinator (+), where the content on both sides of the + is selector expression.
If you want to get the direct sibling element of all the H1 in the following
You can use
In JS----------
JavaScript also provides support for formatted output of numbers
Several formatting functions provided by the number object:
Toexponential ([fractiondigits]): Returns the number in scientific notation format, where
One requirement now is to asynchronously verify that the user name exists. The technology is jquery asynchronous verification and struts2 (in fact, SPRINGMVC is the same reason, are just a controller).
Form:
Copy Code code as follows:
Since I want to have several places to display the current time after the page is loaded, I need to assign values to multiple spans.The span code is written as follows:
Copy Code code as follows:
(multiple spans)
jquery notation:
Copy Code code as follows:
jquery implement role selection effects
Super admin
General manager
Information publisher
Financial Manager
Product manager
Resource Manager
Admin
"/>
>"/>
The latest version of Jquery.lazyload.js is no longer pseudo deferred loading
One, please follow the basic use method to explain the setting
Copy Code code as follows:
Loading JavaScript files
Copy Code code
How do I manipulate DOM elements coherent, on the fly?
For example, order execution "create"-> "Modify"-> "add" three actions.
Because jquery supports chained operations, it is actually the builder pattern of design patterns, so we can string
Delete
The delete operation is very simple, and you can call the Remove () method directly after the result set.
For example, to delete all the A elements in the following HTML script, directly through the
Copy Code code as follows:
When we use destructive method to select and filter the wrapper set, a new result set is produced. For example:
Html
$lt;d iv$gt;
$lt;p $gt; PARAGRAPH$LT;/P$GT;
$lt;p $gt; PARAGRAPH$LT;/P$GT;
$lt;/div$gt;
For the above Dom tree, of course you
Copy Code code as follows:
first name
last name
Email
phone number
John
Smith
john.s
(613) 873-2982
Sean
MacIsaac
seanjmacisaac
(613) 871-6191
Tim
Zarby
zarbytown214@hotmail.com
(613) 743-5389
1. Select from the jquery object:
Slice () () filter () () () () () () () () has ()
2. Use the set of selected elements as a context:
Find () (descendants Element)
Children () (Direct child element)
Contain () (direct child element,
On the basis of the previous, add the direction key around support.
In practical work, we will encounter such a situation. There are 100 of data displayed on the page, and the user also wants him to change the data in it, the normal way may be as
Use this if you want to use the attributes or methods of the HTML element itself, and if you want to use the method or attribute after the jquery wrapper is $ (this), generally there are the following relationships.
Copy Code code as follows:
When you are working on a project, you get a handle on the binding "enter" key, which intercepts the situation code directly. The code is as follows:
Copy Code code as follows:
function Sendlogindata () {
Loginvalidateform ();
$
In Class C languages, they are usually passed by function pointers/references.
jquery also provides a similar callback function mechanism. However, it is still worth mentioning how to correctly pass the callback function.
1. Callback with no
Background
or college and professional relationship, I need to keep clicking the Submit button after the page select continues to maintain the value before submitting
There are several ways to do this, either by passing back the page with the
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