Annotations in Javascript

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

Several small JavaScript Cases

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

Use the eval function in JavaScript to convert a string into a JS Code for execution.

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 week

JavaScript to obtain the current system date and time, day of the weekMethod 1:------------------------------------------------------------------Method 2:(Customize the function method and then call it) -----------------------------------------------

Javascript Object-Oriented Programming: inheritance and overloading

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

Use JavaScript to modify the client registry

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

Create shortcuts using JavaScript

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 )

Javascript Study Notes (3) display the time

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

Javascript Study Notes (4) countdown Program

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

7 tips for writing JavaScript code

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

Tips for dynamic loading of JavaScript code

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

JavaScript "Object-Oriented Programming"-4 functions are also "classes"

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 path of external files referenced on the master page, for example, when loading JavaScript files

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,

JavaScript and Applet Communication

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

A large number of JavaScript code incompatible with Firefox and IE: runtimestyle, event. srcelement

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,

JavaScript code-removes all blank lines and blank lines in a string and contains JavaScript trim implementation.

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.

Awesome opensource JavaScript calendar Control

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:

JavaScript to open the Link Page

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.

Processing cookies using object-oriented ideas in Javascript

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

Optimize JavaScript custom objects

1. Factory method Function createcar (scolor, idoors, impg ){ VaR otempcar = new object (); Otempcar. Color = scolor; Otempcar. Doors = idoors; Otempcar. mpg = impg; Otempcar. showcolor = function (){ Alert (this. Color ); }; Return otempcar; } This

Total Pages: 5378 1 .... 2666 2667 2668 2669 2670 .... 5378 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.