A very good JavaScript debugging method has been found. Currently, four types of Object/array/function/string can be printed. The usage is the same as that of var_dump () in PHP, you only need to directly dump (variable name.
CopyCode The Code
CopyCodeThe Code is as follows: // Date class
Function mydate (time ){
VaR d = new date (time );
This. Y = D. getfullyear ();
This. M = D. getmonth ();
This. d = D. getdate ();
This. H = D. gethours ();
This. M = D. getminutes ();
This. S =
CopyCode The Code is as follows: function jb51tuitan (){
If (getcookie ('jb51popped') = ''){
// Code or operations to be executed
Setcookie ("jb51popped", "OK"); // write cookies to indicate that the cookie has been executed.
Alert ("OK
You can call this method as follows:
1, tempstr = getnewselectstr (datatable. value, "select" + rowindex, true );2, makeselectbox ("select" + rowindex, tempstr, value, OBJ );
Tempstr-this is the frame of the returned drop-down list
1. Click Event ___ onclick
Events generated when you click the mouse button. At the same time, the event processing specified by onclick
Program Or
Code Will be called for execution.
For example,
2. Change event ___ onchangeThis event occurs
For a long time (I am happy to say this here), JS is "an embellishment that can accomplish very limited functions, such as form verification, the language itself has been used as a procedural language, making it difficult to complete complex
Javascript supports regular expressions through the Regexp class. The simplest example is as follows:
CopyCode Code: var regapple = new Regexp ("apple ");
It can match the first "apple" string in a string and is case sensitive. When the second
Record the Javascript access style sheet
Javascript can access the style attributes of elements in a webpage, for example:
Access style attributes through JSAlert (document. getelementbyid ("Main"). style. backgroundcolor );
Modifying style
1. Reference
A reference is a pointer to the actual position of an object. See the following example for reference:
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
In this example, both
Copy codeThe Code is as follows :/*
Factory method --- create and return the factory function of a specific type of object)
*/
Function createCar (color, doors, mpg ){
Var tempCar = new Object;
TempCar. color = color;
TempCar. doors = doors;
TempCar.
12: 35 http://www.jb51.net ah! Stop lover quiet Hot Spring what you look like at 2009-4-9 love song 1980 / li> li Qu 1990 2009-4-9 li Qu 2000 Asia-Pacific orphan partner childhood PM Miss mother 2009-4-9 4-9 4-9 12:35
1. Background
The callback function in Javascript is familiar to everyone. The most obvious example is the callback function provided during Ajax requests,
In fact, the event processing method (onclick, ondblclick, etc.) of DOM nodes is also a
Anchor is believed to be familiar to many people. It facilitates visitors to quickly jump to different locations on the page and directly find the content they are interested in. If RSS is the abstract of the entire website, the anchor is the
To perform client verification on the date format entered in the form, I found a segment of code on the Internet, and used parseInt to determine the year, month, and day. The statement is similar to the following:
......
Else if (parseInt (month) 1
However, we are not familiar with some details. After analyzing these details, John Resig provides us with a perfect solution. This article will introduce in detail:
I. Unknown details about traditional methodsUndoubtedly, when determining the
Javascript can simulate the encapsulation and inheritance features of the forward object, but unfortunately Javascript has very weak support for Polymorphism features! The polymorphism of other object-oriented languages is generally implemented by
In my previous post (translation), I talked about the situations in which various browsers will bring up a script out of control prompt. for Internet Explorer, when the Browser executes a large number of statements, it stops executing the script.
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