Class: divided into public and private
CopyCodeThe Code is as follows: function person (n ){
VaR name = N; // Private Attribute
Function Hello () {}// private method 1
VaR hello2 () = function () {}// private method 2
This. Name = "James"; //
VaR strsex = "male ";
In gb2312 encoding, assume that another variable, straxsex, is the BSTR value read from the ActiveX control, and the original value is also "male ".ProgramIn comparison: strsex = straxsex is false, that is, "male "! = "Male "
[Click to copy 1] copy content 1 [Click to copy 2]
Copy content 2 [Click to copy 3]
Copy content 3
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]
the following content mainly
Class inheritance implementation mechanism in prototype framework
CopyCode The Code is as follows: // Add a static method for the object class: Extend
Object. Extend = function (destination, source ){
For (property in source ){
Destination
The format is as follows:
CopyCode The Code is as follows: varoeditor = fckeditorapi. getinstance ('content ');
Varcontent = oeditor. getxhtml (true );
**************************************** *********Using JavaScript to retrieve and set the
The pointer of the idispatch type indicates that the array object is actually a javascript built-in array object. On the Javascript side, we can get the size of the array through the Length attribute, you can use the getidsofnames and invoke
1. all the previously written functions have been scattered. If you use any function, you can write any function that is not neat enough. Therefore, this write is an encapsulated class, which is not bad to use, however, many problems have been
1. js
Code
Copy code The Code is as follows: // ************ the default setting definition. *********************
Tpopwait = 50; // The prompt is displayed after the twait Hao seconds.
Tpopshow = 5000; // display the tshow Hao seconds before
Code Writing is cumbersome, and many methods are very primitive...
The Code is as follows:
Xmlns = "http://www.w3.org/1999/xhtml">
2005-09-02Download webpage standards and standards guide
Use the module to quickly
I. Error implementation
Many people may directly assign values using equal signs:
CopyCode The Code is as follows: var array1 = new array ("1", "2", "3 ");
VaR array2;
Array2 = array1;
Array1.length = 0;
Alert (array2); // The returned result is
The following demo supports callback and can be directly referenced by modaldialog. js without any jquery shadow.
Global. js
CopyCode The Code is as follows: window. JS = new myjs (); // to avoid repeated names, add a myjs object to the window
First, create an instantiated object of the parent class, and then assign the object to the prototype attribute of the subclass.
In this way, all public instance members in the parent class will inherit from the quilt class. When the instanceof
The common practice is Var jsondata = eval (XMLHTTP. responsetext ). It seems that everything is correct, but when you run
Code You will find the "invalid Labe" error. Why? I don't know, but I found a solution to this problem.
I also had a
Code The snippet is as follows: -->
Copy code The Code is as follows:
select all
select all
Copy codeThe Code is as follows:
Put the above Code in the body.
1: date conversion and comparison are often involved:
Copy codeThe Code is as follows:
2: Date Format judgmentCopy codeThe Code is as follows: // yyyy-MM-ddIf (! /^ \ D {4} \-\ d? \-\ D? /. Test (datavalue1 )){Alert ("the date format of
SetTimeout (expression, latency)
SetTimeout (expression, interaction time)
The latency/interaction time is in the unit of haoss (1000 ms = 1 s). When setTimeout is executed, it is executed once after the specified delay time after loading, and only
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