Javascript
Data transmission between forms!
Today, a friend asked me about the usage.JavascriptI have written about the problem of data transmission between forms on the page before, but I have never paid attention to it. I have summarized it
1. Discard the fractional part and retain the integer part.
Parseint (5/2)
2
2. rounded up. If there is a decimal number, add 1 to the integer.
Math. Ceil (5/2)
3
3. Rounding
Math. Round (5/2)
3
4.
ClipboardData object
Provides access to the clipboard.
Three methods1. cleardata (sdataformat) deletes data in the specified format on the clipboard.2. getdata (sdataformat) obtains data in the specified format from the clipboard.3. setdata
In the applet, JavaScript is called.ProgramThe call method is as follows:1. first introduce the jsobject package// Liveconnect... for JavascriptImport Netscape. Javascript. jsobject;2. Use the following code to call javascript:Try {// create a
This section describes how to adjust the size of an image using JavaScript. The following is the JS Code.
When I update an article on my website, a common problem is that the illustration of the article is too wide, and the entire webpage is
I
VaR Lennon = array ();Lennon ["name"] = "Windy ";Lennon ["year"] = "1989 ";Lennon ["living"] = true;Alert (Lennon. Length );Result: Lennon. length is 0. Cause:Add an array element without changing the length of the array.Arr ["A"] = 3;
IIVaR
/*** Each is a set iteration function that accepts a function as a parameter and a set of optional parameters * This iteration function calculates each element and optional parameter of the set using a function in sequence, return the calculated
Transferred fromHttp://www.mangguo.org/javascript-prototype-constructor-inheritance/
Speaking of the basic mechanism of JavaScript prototype inheritance, this article details the inheritance of constructors.
From a simple example, create a people
Transferred from:Http://www.cnblogs.com/snandy/archive/2011/03/06/1972264.html
Part 1,
Constructor + prototype assemble a class. The same constructor can define multiple types.
01
/**
02
* $ Class write tool
Javascript Time FunctionsJavascript provides the date object for time and date calculation.
The date object has multiple constructors:
New Date () // current timeNew Date (milliseconds) // The number of milliseconds from the start time to January 1,
As you need to implement instant message prompts in the system, refer to the code written by others to form the following MSN information Prompt window using JavaScript.
Detailed analysis of the methods for JavaScript to access HTML page controls
During this period of time, the company was relatively idle and decided to study the Javascript access to HTML controls. This is very common. Here, I systematically studied
Javascript allows only numbers.
1. Only numbers and decimal places are allowed.
2. The judgment is more detailed, and even 22 .. 2 is not counted as a number.
3. Only integers are allowed. In fact, some restrictions can be made based on article 3.
4
Find an article about JS date objects:
Http://blog.csdn.net/xxd851116/article/details/3859587
There is also a script that can format the date and put it at the end.
Create a date object:VaR objdate = new date ([arguments list]);The following five
Javascript web page Printing
Normal print (full page)Print some content in the webpage (custom)Print remove/Add header and footerUse external controls/methods for multi-function PrintingPrint background
The above is code control
Set "page settings"
1. Create element nodesThe traditional JavaScript method creates element nodes.
Program code
VaR A = Document. createelement ("p ");
The method for creating a node in jquery is:
Program code
$ (' ');
Like createelement (), the newly created element
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