/*********************************************************************************
* Eo_jslib.js
* JavaScript Regular expression test
**********************************************************************************/
The checksum is all made up of
For most developers, the This keyword of JavaScript can cause a lot of trouble. Because JavaScript does not have a strict class model for languages such as Java, this point in the code is not clear unless you are dealing with callbacks.
In general,
1. String to Array
The string in JS and the same in Java, are immutable constants. The early ECMAScript standard resolves string to an immutable array of characters, supporting access such as Str[index]. Firefox still supports it until today, but
Name is a global property of window, including ie6,7, which is supported by almost all browsers.
Using Window.name to transfer data across domains is a feature of its use: Window.name has been saved even though the refresh, url jump
The
JS object go to jquery object
The code is as follows
Copy Code
Joan Taiwan blog JS and jquery objects to each otherJS Get Objectvar obj = document.getElementById (' id ');Convert a JS object to a jquery objectvar $obj = $
Instead of replacing Chinese with normal replace, we use the new regexp to implement Chinese substitution.
JS Replace and ReplaceAll instance usage
Stringobj.replace (Rgexp, ReplaceText)ParametersStringobjRequired option. The
1. Floating point conversion to integer type, this is more error-prone, many people like to use parseint (), in fact, parseint () is used to convert strings to numbers, rather than floating-point number and integer conversion between, we should use
JavaScript String Object
Let's take a look at an instance of the length of the returned character.
Result is 12
Let's look at an example.
The IndexOf () methodHow to use the IndexOf () method to return the position of the first occurrence
Web effects browser and operating system type
var browserdetect={Init:function () {This.browser=this.searchstring (this.databrowser) | | " An unknown browser ";This.version=this.searchversion (navigator.useragent) | | This.searchversion
Web effects to create their own classes and objects, we should be mastered, we all know that the properties of the object in JavaScript can be dynamically defined after the object is created, such as the following code:The code is as follows:
Let's take a look at its definition:
The code is as follows:
var arrayobj = new Array ()
var arrayobj = new Array ([size])
var arrayobj = new Array ([element0[, element1[, [, ELEMENTN]]])
Where: Arrayobj is the variable name assigned
GrammarThisThis.propertyOften get used to scripts that are specified in a function through an entire object, such as those contained in a form or method.
Take a look at this instance
Using This in passing form informationThis is some text in I
Web page Special Effects object Detailed application Example
1. When an attempt is to retrieve the value of a member element that does not exist for an object, a undefined value is returned. You can go through the "| |" operator to populate the
This article implemented the Dos attack method is very simple is set a few seconds to refresh the current page, which can effectively prevent Dos attacks.
Look at the example below
Title: Content:
Tip: you can modify some code before running Javascript beautiful and practical perpetual calendar codeBeautiful and practical perpetual calendar与之间-->与之间--> AD Year Lunar calendar year [year]
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