This time, let's look at the example:
CopyCode The Code is as follows:/*** defines static classes ***/
VaR staticclass = (function (){
VaR return = {
Property: "Test static property", // public property
Method: function () {// public Method
Alert (_
For example, you want to directly press the Enter key to submit the form immediately after entering the keywords. In some complex forms, you may need to avoid incorrect input keys that trigger the form submission when the form is not completed.
Call Method
See
Applied to: Function objects
Requirements
Release 5.5
Call a method of one object to replace the current object with another object.
Call ([thisobj [, arg1 [, arg2 [, [,. argn])
Parameters
Thisobj
Optional. Will be used as the object
JavaScript Information Encapsulation
Before coding, we need to understand the following terms;
Encapsulation: hides the internal data representation and implementation details;
Private attributes and Methods: external users can only access and
Singleton)
A unit is created when a script is loaded. It organizes a series of associated variables and methods into a logical unit. The content in the logical unit is accessed through a single variable;
A monomer is mainly divided into
(1) how to use jquery to refresh an image?
Note: We all know that when we request a resource (such as a webpage or image), if the resource is cached in the browser, the request returns a cached copy, it is not the resource we want to obtain (the
ArticleDirectory
After entering the information, press enter to verify it! (The simplest !)
Note: ie6.0, ie7.0, ie8.0, and Firefox/3.0.11 are successfully tested.
Xmlns = "http://www.w3.org/1999/xhtml">
After entering the
Main functions
Code :
Copy code The Code is as follows: function Chinese (Num)
{
If (! /^ \ D * (\. \ D *)? $/. Test (Num ))
{
Alert ("You did not enter a number. Please try again! ");
Return false;
}
VaR AA = new array ("zero", "one", "two",
Background
Both encodeuri and encodeuricomponent are functions defined in the ECMA-262 standard and will be implemented in all languages compatible with this standard (such as JavaScript and ActionScript. They are all global functions used to
The doctype Declaration is an essential part of building a standard web page. Your logo and CSS will not take effect unless your XHTML determines a correct doctype; of course, JS values will also be affected.
Doctype Declaration:
Doctype
In some transfer pages, gb2312 is used, and utf8 is used on the receiving page. In this way, the received parameters may be different from the original ones. The URL encoded using the urlencode function on the server is different from the URL
Mode type: factory Mode
Mode Description: One of the common modes used to dynamically create objects
Applicability: classes that need to be selected in a series of interchangeable subclasses during running
Note: The implementation of
First, define the progress bar display layer:
CopyCode The Code is as follows: download progress:
Define the ad layer:Copy codeThe Code is as follows: Define the flash display layer:
JS Code:Copy codeThe Code is as follows: If (window.
Regular Expression Method
CopyCode The Code is as follows: function checkrate (input)
{
VaR Re =/^ [0-9] + .? [0-9] * $/; // determines whether the string is a number. // determines a positive integer./^ [1-9] + [0-9] * $/
If (! Re. Test (input.
Why not use textarea?
1 not highlighted
2. The Tab key is unavailable. -- Press the tab key to switch to the next control.
3 NoCodeFormat. -- Because you are used to the eclipse environment, you can use Ctrl + Shift + F to format the code.
Although jquery's use is gradually reduced (it is still used in projects, and the efficiency is high. I usually don't need it). I hope to reduce the dependence on jquery.
However, this chain operation method is really attractive (it seems that many
After checking a large amount of information, I summarized the following three rules, which can solve all the problems I have encountered.
Rule 0: the function itself is a special type. In most cases, it can be considered as a variable.
CopyCode
JS Add/delete events in IE and Dom browsers are: attachevent (add event in IE), detachevent (delete event in IE), and addeventlistener (add event in Dom browser ), removeeventlistener (supports deletion events in the DOM browser ).
For example,
I. multiple choice questions
1. Which of the following statements will generate a running error? ()
A. var obj = (); // syntax error
B. var obj = []; // create an array
C. var obj ={}; // create an object
D. var obj = //;
Cause: var obj = new Array
In JavaScript, you can use new Array to create an Array. The following syntaxes are correct:
ArrayObj = new Array () to create an Array.
ArrayObj = new Array ([size]) Create an Array and specify the length. Note that the length is not the upper
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