CopyCode The Code is as follows: function ontreenodechecked (){
VaR ele = event. srcelement;
If (Ele. type = 'checkbox '){
VaR childrendivid = ELE. Id. Replace ('checkbox', 'nodes ');
VaR DIV = Document. getelementbyid (childrendivid );
If (Div! =
Document. Title // set the document title equivalent to the title tag of HTML
Document. bgcolor // set the background color of the page
Document. fgcolor // set the foreground color (text color)
Document. linkcolor // The link color that has not
CopyCode The Code is as follows: function searchparse (){
VaR resultobj = {};
VaR search = Window. Location. search;
If (Search & search. length> 1 ){
VaR search = search. substring (1 );
VaR items = search. Split ('&');
For (VAR Index = 0; index If
Jquery operations on non-set array Functions$. Trim (value)This function is simple. Remove any leading or trailing white spaces from the value. The white space character is any character that matches the Javascript Regular Expression \ s. Including
Of course, we can also use regular expressions for direct matching,
Article An example of regular expressions is also given.
Link decomposition method:
CopyCode The Code is as follows:
Regular Expression matching:Copy codeThe Code is as
I. Test Environment
Browser: IE6 +, FF 3.5.5, opera 10, chrome 4.0.249, Safari 4.0.3
Ii. ExampleCopyCodeThe Code is as follows:
3. solution (the method I think of is to change the acquisition method, based on Yui) Copy codeThe Code is as
:
Note the following
Code , It is best to save it as UTF-8 format, otherwise garbled.
Copy code The Code is as follows:
JavaScript Kingsoft network translation
1. encodeuricomponent is required when passing parameters so that the combined URL will not be truncated by special characters such.
Example:
2. encodeuri can be used for URL redirection.
Example: location. href = encodeuri
Example:
CopyCode The Code is as follows: var Qs = new querystring (query );
Qs. Set ("ajaxids", IDS)
Qs. Set ("ajaxsn", new date ())
Query = Qs. tostr ();
It can also be called consecutively: Copy codeThe Code is as follows: query = new
Review
The event object contains three pieces of information!
The attributes and methods in the event object are mainly the mouse and keyboard information.
1. Get the Event Type
Event object property type
2. Obtain buttonsCode
Event
Speaking of JS object-oriented, we have to mention prototype, the JS built-in attribute (Note: Prototype is not prototype here. JS), which can dynamically add certain attributes to an object. What I want to do now is try to makeCodeTo achieve public,
One day, I began to piece together Dom labels in JS, And I found my
Code Increasingly ugly, not only the code is concise, but sometimes it also causes performance problems. In the long run, in less than three months, God will not know what I have
You must decide which of the two methods to write your JavaScript code. To help you make a wise decision which is more suitable for you, we will compare the advantages and disadvantages of the two methods.
One disadvantage of using JavaScript
Inside
Code The modification is also relatively simple.
script home Baidu Google webmaster tools Print Haha I am a link happy! View Print Haha I am an image although it cannot be opened View Print menu 1 menu 2
Event
Events are part of the DOM (Document Object Model. Event stream is the sequence of events, which is the main difference between IE and other browsers in event support.
I. event stream
1. Bubble events
The solution on IE is a bubble event.
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