Copy Code code as follows:
Repaint (redraw), the appearance of the element changes when the repaint changes, and occurs without changing the layout, such as changing the outline,visibility,background color without affecting the DOM structure
The rules for writing XHTML code are much stricter than writing HTML, and code like the following is valid in HTML, but not in XHTML.
[JavaScript]
Copy Code code as follows:
In HTML, there are special rules to determine
Highlighting is the highlight of the specified text in the page, which is the background coloring. This feature is commonly used in search results pages.
Here is a solution for everyone, using JavaScript to implement.
First, introduce the
The SetInterval method can be used to implement circular call functions at specified intervals until the Clearinterval method cancels the loop
When you cancel a loop with the Clearinterval method, you must assign the call to the SetInterval method
In the knowledge of some of the published and JavaScript-related questions, and share with you, although it is n long ago, but these questions are quite classic, it is inevitable that JavaScript is really a pain in the door of the language.
1.
That's what I used to do:
function Dog () {
this.name = ' Hachi ';
}
Dog.prototype = {
makenoise:function () {
alert (' Wangwangwang ');
}
;
Then I saw another complex and seemingly unnecessary way to do it:
Event-driven in JavaScript is the main event that is raised by the action of a mouse or hotkey as follows:
1, mouse click event
onclick such as: ()
Typically used for the following controls:
Button Buttons ObjectCheckBox checkbox or Check
Variable naming should also adhere to one of the following well-known naming conventions:
The famous variable naming rulesCamel Labeling MethodThe first letter is lowercase, and the following letters begin with uppercase characters. For example:
Call () methodThe call () method is the most similar method to the Classic object impersonation method. Its first argument is used as the object of this. Other parameters are passed directly to the function itself. For example:
Copy Code code
0.009.toFixed (2) Should have returned 0.01 results, but it returned a 0.00, this is a bug in this method, and this method for the client's JS version of the request is a bit high, at least in the IE5.0 this method does not work, so I wrote the
Cancelbubble is effective under IE
Stoppropagation is effective under Firefox
Copy Code code as follows:
prevent JavaScript event bubbling (cancelbubble, stoppropagation)
this is Parent1 div.
this is child1.
this
I am now through the following:
O=odom.createelement ("script");
O.text=document.all.checkrule.value;
ODOM.body.appendChild (o);
You can add a checkrule function,
But I do this code multiple times to insert this checkrule function, so how do I
text encryption and decryption text encryption and decryption: Copy your text into the following input box, you can complete the encryption and decryption of text text Encryption and decryption copy your text into the input
Poisoning Object.prototype
Object.prototype.bar = 1;
var foo = {goo:undefined};
Foo.bar; 1
' bar ' in Foo;//True
foo.hasownproperty (' Bar ');//False
Foo.hasownproperty (' goo ');//True
Here, only hasownproperty can give the correct answer,
A few days ago I wrote a small program with setinterval, this setinterval is used to do I do not explain.
The writing method can be used in other browsers, and then the Test team's colleagues took a survey and went out of the question. Because
The examples in this article describe JavaScript event usage. Share to everyone for your reference, specific as follows:
JavaScript interacts with HTML through events.
Event Flow
The event flow sets the trigger rules and order of events. DOM2
This article analyzes the JavaScript recursive operation. Share to everyone for your reference, specific as follows:
Problem
A simple recursion that asks for the factorial of N:
function factorial (n) {
if (n
If you use it as
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