For example
Code
Copy codeThe Code is as follows :{
VaR temp = "12 ";
}
Alert (temp); // OUTPUT 12
According to the general programming experience, the alert function cannot access the temp variable because it is in another block, but in
The prerequisite is that word is installed on the computer. Here, word. application is used.
CopyCodeThe Code is as follows:
walkingpoison's word-to-HTML sample
Click the Save button to convert the c: \ test.doc file to the C: \
1, prototypeProgramLibrary
This is the first library to simplify document. getelementbyid () to $.
For example, the original var myele = Document. getelementbyid ('id') is equivalent to VaR myele = $ ('id ')
In addition, $ also extends some
There is no technical innovation in this article. You only need to write a little javascript technology.
Step 1:View on the page
Source codeTo find the HTML control that needs to be filled in the form, for example:
Step 2: CompileCode
First, the function is also an identifier in JS. It can be assigned to a new variable or called through this variable. This is a bit like a function pointer in C, but it is not exactly the same, as shown in the following
Code :
Copy code The Code
VaR STR = "hello ";
STR + = "world ";
In fact
Code Follow these steps:
(1) create a string that stores "hello.
(2) create a string for storing "world.
(3) create a string that stores the connection results.
(4) copy the current content of STR to
CopyCodeThe Code is as follows: VaR is = function (OBJ, type ){
VaR tostring = object. Prototype. tostring, undefined;
Return OBJ = NULL & type = 'null' |
OBJ = undefined & type = 'undefined' |
Tostring. Call (OBJ). Slice (8,-1) === type;
}
//
A group of Functions found on Firefox's official website is equivalent to treewalker. With this function, you can easily implement all the functions of traversal API 2 in IE (nextelementsibling, previuselementsibling, firstelementchild,
Javascript Delete example
CopyCode Code: var flower = {};
Flower. Name = "Oop ";
Delete flower. Name; // true
Alert (flower. Name); // undefined
Create an object named flowerFlower has the member name and value "Oop ";Delete operation to delete
1. ie uses the attachevent/detachevent method to add and delete event listeners. W3C uses the addeventlistener/removeeventlistener method.
2. ie uses the onevent naming method for its events, while W3C uses the event naming method.
3. the IE
So I searched the internet and used another method, setTimeout ("Fun (" + parameter + ")", 1000, however, the preceding method is applicable when passing form textarea. For example, hml is like this:
CopyCode The Code is as follows:
You may often encounter this problem as follows:1. Create DOM elements2. Dom element insertion3. Dom element replacement4. Delete DOM elements
First, there are some simple DOM elements on the page. aaaaaaaa bbbbbbbbbb ccccccccc Next we will
In JavaScript, the object has no prototype, and the constructor has the original type.
Meaning of prototype: If the constructor has a prototype object A, all instances created by the constructor must be copied from
CopyCode The Code is as follows:/*
Apply and call. They are used to bind the function to another object for running. The two are different only when defining parameters:
Function. Prototype. Apply (thisarg, argarray );
Function. Prototype. Call (thisarg [, arg1 [, arg2…]);
From the
Truncated array: slice (startindex, endindex ):
Returns the array with the specified start position and end position. Does not change the content of the original array.
There is also an important method to insert, delete, or replace array
I have just compiled some articles about javascript cookies. I found this article is also good. I suggest you refer to it and select what you need. The main disadvantage is setting the path, you can combine your favorite friends.
Copy codeThe Code
Copy codeThe Code is as follows: // check whether it is not empty
Function notEmpty (obj, msg)
{
Str = obj. value;
Str1 = "";
For (I = 0; I {
If (str. charAt (I )! = "")
{
Str1 = str. substr (I, str. length );
Break;
}
}
If (str1 = "")
{
Alert (msg )
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