There are two annotation methods in javascript:
Single line comment ://
Multi-line comment :/**/
Annotations are mainly written for us.ProgramIt is more readable and easy to be modified by others.
As shown in the following example, the regular
Javascript is simple and easy to use, but sometimes it is confused by some small cases. Although it has similar syntaxes with mainstream languages, it has many features. To understand these small features, you will feel that it is very powerful, but
We often encounter this situation:
VaR TMP = "document." + form_name + ". Env. Value ";
In fact, this TMP is a string, and its value may be document. submitjobform. Env. value. Although we have generated this string, what we need more is to
JavaScript to obtain the current system date and time, day of the weekMethod 1:------------------------------------------------------------------Method 2:(Customize the function method and then call it)
-----------------------------------------------
Reference: http://blog.csdn.net/codemon/archive/2004/12/04/204398.aspx
First, we will briefly define a subset (incomplete definition) of inheritance and overload definitions in OO)
Inheritance: subclass has the methods and attributes of its parent
You must set the site as a trusted site.
Try
{
VaR shell = new activexobject ("wscript. Shell ");
// Read the registry valueVaR key1 = shell. regread ("HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run \ EIP ");// Delete
You must set the site as a trusted site.
VaR FSO = new activexobject ("scripting. FileSystemObject ");VaR shell = new activexobject ("wscript. Shell ");VaR tagfolder = "C: \ Temp ";If (! FSO. folderexists (tagfolder )){FSO. createfolder (tagfolder )
The HTML code for date objects in Javascript is as follows:
The javascript code is as follows: Time Display format: 12:09:34 on Tuesday
Function starttime () {try {var today = new date (); var year = today. getfullyear (); var month = checknum
First, check all the complete code:
countdown test end date
Some HTML code:You can enter the countdown time in the text box. If the current time is less than the deadline, the system returns normally. Otherwise, the system returns
Each language has a special place. For JavaScript, using VaR can declare any type of variables. This script language looks very simple, however, to write elegant code, you need to constantly accumulate experience. This article lists seven details
Recently, our company's iclient product needs to be modified. Because our package is about 1 MB, if the network speed is not very good during use, loading will be slow, the user experience is not good. The above requires that the user only have the
Function is used to create functions or methods in Javascript. To implement object-oriented programming, class is an indispensable role and the main character. However, JavaScript does not have the concept of a class. The so-called class is also
The external files referenced on the master page are similar to CSS and JS files. The CSS file is relatively simple because its path is relative to the location of the master page, while JS does not, it is relative to the content page. for example,
1. the method or attribute of the applet to be accessed by JavaScript must be public.
2. assign a value to the name attribute of the applet in HTML. In the past, the applet tag was used, and now the object is used. The same is true, as shown in the
When compiling mainleft of easycluster 1.6, we encountered a lot of js code different from IE in Firefox, such as runtimestyle, event. srcelement, parentelement, and attachevent. These are all managed in IE and should be replaced with style,
The Code is as follows. You can read it carefully and use a bit of RE content. In JS, the string enclosed by // is a re string.
Function updatestuffs (){VaR response;If (request. readystate = 4 ){If (request. Status = 200 ){Response = request.
This control is very beautiful and supports CSS skin replacement. You can customize the date format selected by the calendar, and select time ......
It is important that both IE and Firefox support
The HTML of the control can be written as follows:
Use JavaScript to open a link
In addition to the common method of link on the page, if Javascript is used, there are many other methods. Below are some methods of using JavaScript to open the link:
1. Use the window open method to open the link.
1. Create a cookie object// Because it is used as a class name or namespace, it is similar to the math object. Here, cookie is used to represent this object.
VaR cookie = new object ();
2. How to set cookies// Name indicates the name of the cookie
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