When using JavaScript to add decimals (floating point number), the number of decimal places is not accurate (for example, 2.01 + 90.01 = 92.02000000000001 ). You can use the following function to solve this problem:
// Addition function, used to
I. Statements
1. Compound statements can combine several expressions with commas to form an expression, and several statements can be combined with curly brackets to form statement blocks. Composite statements support break, continue, return, and
usage example of the three pop-up dialog boxes
there are three types of dialog boxes
1: only a reminder. No changes can be made to the script.
2: generally used for confirmation. True or false is returned, so it can be easily used for
From: http://www.cnblogs.com/cncxz/archive/2007/07/15/818508.html
/*----------------------------------------*\* Mark highlighted keywords by markcxz (markcxz@aol.com) with JS)* Parameter description:* OBJ: object. html tag nodes to be highlighted.*
Effect:
Note:When you click "hide", the "test area" is hidden.
Source code:
hide display
test area
Supplement:There is a problem. If "hide" is selected by default when the page is opened, how can we make the "test area" hidden by default
Differences and solutions between Javascript in IE and Firefox
1. load XMLIE creation object:Msxmlax = new activexobject ("Microsoft. xmldom ");Firefox creation object:Xdoc = Document. Implementation. createdocument ("", "", null );
The general
1. check whether a string is composed of digits. 1
11
2. Press enter to move the cursor to the next input box. 1
3. Confirm deletion 1 Delete
4. Refresh the parent window 1window. opener. Location. Reload () in the opened Child Window ()
I 've been confused for a few days, and I 've been lazy recently. I saw a message and never updated my blog's first prize. It's quite embarrassing, haha. Write down some minor problems that you or others have encountered recently.
1. About
Use JavaScript to obtain and set the cursor position in textfield
Original article:Http://www.webdeveloper.com/forum/showthread.php? T = 74982
Code highlighting produced by Actipro CodeHighlighter
JS Code is often called in Asp.net. If JavaScript code is written in Asp.net, it will not be garbled. Because they have the same encoding.If you need to reference external JavaScript code, there is a risk of garbled code. Under normal circumstances
Inheritance and closures in Javascript
Two methods to implement inheritance
Using the "call" function, call allows us to call another function in a context. We call the animal class in cat and dog classes.
Code highlighting produced by Actipro
scale the image proportionally The size of the original graph is as follows: proportional reduction: proportional amplification: (in fact, the image size cannot be enlarged, but the original size is displayed)
I. Basics
1 case sensitive
2. Each statement ends with; ends
3 // and/**/is a comment
4 {} defines the statement block. Only one sentence can be omitted. For readability, I usually do not omit it.
5. values can be assigned consecutively.
6.
1. Set the selected node. For example, select the second node.Function setselnode (){Treeview1.selectednodeindex = "1 ";}
2. Get the text, ID, or nodedata of the selected node.Function getattribute (){Alert (treeview1.gettreenode
A time-based clock function show ()
{If (! Document. Layers &&! Document. All)
Return
VaR digital = new date ()
VaR year = digital. getyear ()
VaR month = digital. getmonth () + 1
VaR day = digital. getdate ()
VaR hours = digital. gethours ()
VaR
Time
2.1 short time, such as (13:04:06)
Function Istime (STR)
{
VaR A = Str. Match (/^ (\ D {1, 2 })(:)? (\ D {1, 2}) \ 2 (\ D {1, 2}) $ /);
If (A = NULL) {alert ('input parameter is not in the timeformat '); Return false ;}
If (A [1]> 24 | A [3]> 60
Write the onclick event processing code in a button on a webpage, accidentally written as follows:After an error occurs in IE, the following error occurs:The result is still incorrect.At this time, I cannot figure it out. Although I know that the
1. UnderstandingThis is the late binding. The determined value is the object attached to the final call, that isXxx. YYY () syntax. If not specified, it is a global object, and the webpage is a window object.The value assignment statement only
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