CopyCode The Code is as follows: function keypress (EV ){
If (EV. keycode = 13 ){
// Create an area where the cursor is located.
VaR range = Document. selection. createRange ();
// Set the content of the region to a line break.
Range. Text = "\ n ";
Common garbled characters:
1. The client submits data to the backend. The parameter value is garbled, for example, A. aspx? Value = "Chinese value" & type = "% $ # (& _ special symbol ";
2. garbled characters appear after the background reads data
An article I wrote earlier
Article I encountered this kind of problem. Later, I used CSS overflow and max-width attributes to temporarily solve the page deformation problem. The advantage of this method is that it is simple, but the disadvantage is
After a form is displayed on the page, the focus is usually not placed on the first control. You only need a common script to achieve this effect.
Document. Forms [0]. elements [0]. Focus ();
If the first control on the page is a hidden field, or
Heap Value Type
Primitive type)
Undefined: Undefined (case sensitive: type/value, the same below)
Null: NULL (undefined derived from null)
Boolen: True/false
Number: number. max_value/number. min_value/nan; isnan () function (Note: The new version
CopyCode The Code is as follows: function callbackobject ()
{
This. XMLHTTP = This. gethttpobject ();
}
Callbackobject. Prototype. gethttpobject = function () // Add the gethttpobject common method to the callbackobject prototype dynamically.
{
//
Javascript timer that is easy to fool others' feelings
The setTimeout and setinterval of JavaScript are two methods that can easily fool others' feelings, because we often think that the call will be executed in the established way. I think
True: Completely copying a node. What is "complete" means copying everything, including its subnodes, so that all the text nodes and all others are cloned.
False: only the current node is cloned. No child node is cloned. Of course, the wrapped
The specific usage is as follows:
Convert Javascript
Code Put it before (placing the script code at the bottom of the page helps improve the page speed, but I do not know it yet)
Copy code The Code is as follows:
The following is the HTML
1. Add the following to :
Code
Copy code The Code is as follows:
2. add the following code to onload = startclock () 3. insert the following code at the display time, we recommend that you use table positioning [Code]
/
Method 1: It is quite helpful. The page can be opened only after confirmation. The principle is also clear. It is mainly used to confirm deletion of a single message.
call method: Delete
[Ctrl + A select all Note: If you need to
Generally, window. onload is enough. To load multiple events, we can use the following method:
CopyCode The Code is as follows: window. onload = function (){
Func1 ();
Func2 ();
Func3 ();
// Load more events ..................
}
But can't we write
IFRAME has recently been used in several projects. Sometimes there are multiple IFRAME in a page, and several IFRAME need to access each other's functions or parent window functions. Today, I will organize the page framework programming.
All frames
Of course, this time-based loading technology is only a secondary technology and does not have the ability to add nodes. Now, asynchronous innerhtml, another more exotic technology, has been developed again. I can't help but praise foreigners for
1. Standard Method
CopyCode The Code is as follows:
Example: click
2. It should be noted that Firefox does not support this function. The syntax it supports isCopy codeThe Code is as follows: window. Open('Openwin.html ', 'newwin', 'modal =
Summary
Private variables are declared using the 'var' keyword inside the object, and they can only be accessed by private functions and privileged methods.
Private functions are declared in the object constructor (or through var functionName =
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