For... The in statement is used to traverse the attributes of an array or an object (looping the attributes of an array or object ).
First define a constructor:
VaR status = function (ARG) {This. Arg = ARG;} status. Prototype. getstatus = function
Javascript: Changes and controls the size of the displayed image (maintaining the ratio and limiting the height and width ), 100); I ++) {This. width-= This. width/10}/* alert (this. width) */"_ onload =" alert ('change the image, but it's an
1. Onabort (NS3, ns4, ie4): this event is generated when the user terminates a webpage being opened.
2. Onblur (NS3, ns4, ie3, ie4): this event is generated when an element loses its active focus. For example, you can click the mouse in the text box
Since the context menu is displayed, We need to intercept the event oncontextmenu when right-clicking the genie.
Then, encapsulate the HTML of the right-click menu into a function. At first, this menu layer is hidden.
Function getmenuhtml
Generate sitemap with one line of code
You can also copy the following content to the address bar and press ENTER :)Javascript: var u = document. location. href; var T = prompt ('input Update Time:/n/N', ''); var P = prompt ('input index level: /n/
// Date subtraction in Javascript is very troublesome. Now there are ready-made implementation methods, which can be used after copying.
// Call this method (main method)Function datediff (date1, date2 ){VaR type1 = typeof date1, type2 = typeof date2
With the with statement, you do not need to specify the reference object again when accessing the object attributes and methods. In the with statement block, any properties and methods that JavaScript does not recognize are related to the objects
Common JavaScript For webpages
1. Keep text scrolling
scroll text
2. Record and display the last modification time of the webpage
3. Close the current window
close the window
Close the current page in 4.5 seconds
The client dynamically outputs table data and displays tables, which is a common task in Web applications. For cyclic Print Output TR, TD itself
Is a very rigid and violent programming method, coupled with the final binding element innerhtml
Content added in (2:
Differences between mobile Web form and web form:
Mobile web form does not support theme, but mobile Web form can use stylesheet.
Modify (1) content:
When the simulators and Microsoft ActiveSync cannot be synchronized, follow
I. What is a javascript timing event?
You can use JavaScript to implement code execution in a delayed manner. That is to say, when a function is called, some code is not executed immediately,
Wait for a specified period of time before execution.
Two days ago, I had to write a select operation. Because of the urgent delivery, I wrote a ListBox operation and handed it in,All events are written on the server. I think it is not very good. I have rewritten one today. It is the interaction
// Function name: chksafe
// Function Description: Check whether "'",' // ', "/" is included "'",'//',"/"
// Parameter description: the string to be checked
// Return value: 0: Yes 1: No
Function chksafe ()
{
Return 1;
/* Maid = new array ("'","//","
From: http://blog.csdn.net/feng19821209/archive/2005/04/16/349756.aspx
Q:Double-click automatic screen scrolling.A:Add the following code to the page for automatic screen scrolling
VaR currentpos, timer;Function initialize (){Timer = setinterval
Many Web developers may have encountered such a problem, and the program is inexplicably surprised to see that "the code of the released script cannot be executed", error Row 1, column 1. the descriptions of such messages are confusing, and the
Once you get the variable that represents the window, you can manipulate it in various ways. In the previous introduction, we discussed the close () method:
Win = Window. Open ("http://www.docjs.com/", "JS ");
Win. Close ();
Javascript provides
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