Time: 2006-3-6
Author: Weeping Red Pavilion
Brief introduction:
Original source: www.51js.com
Description: June 15, 2004
Translation:
Recently in the worry-free script mixed for a while, replying to some posts, I did not make anything to let
A string object is used to process text (strings).
1. Create string
Copy Code code as follows:
var str = "Hello world";
var str1 = new String (str);
var str = String ("Hello World");
All three methods are OK, but slightly
This article introduces the basic (commonly used) grammar of JavaScript for your reference.
Overview
Let's talk about how JavaScript should be written. Two forms, one is to write JavaScript directly in the HTML page, the other is to exist in the *.
Use the IEEE754 format to represent integer and floating-point values.floating-point value: The value must contain a decimal point, and must have at least one digit after the decimal. A floating-point number requires a memory space that is twice
There are also some properties and methods for the built-in math math entries and functions. For example, the Pi property of the Math object will have the property value Pi (3.141 ...), and you can call it like this:
Math.PI
Similarly,
Operations on variables in JavaScript are referred to by reference, and the same is the case for arrays.
Two days ago want to copy an array, has been struggling to find a way (traversal of the method I was absolutely not used)
Accidentally picked
I got a question about the text box ReadOnly property this morning.
Specifically: Use JavaScript to modify this property.
Just start in the JavaScript is dead or alive can not get the value of this property, no way, to search the Internet. Not
There are several modes in JS that can create objects and manipulate the properties and methods contained in the object.
In general, the first letter of a constructor name is a capital letter, the first letter of the non-constructor name is
Callback to Hell
For JavaScript programmers, the process callback is homely, but the processing level of the callback is not so good, the following example code fragment with a three-layer callback, and then brain more layers of scenes, is simply
SCRIPT tag
Used to include JavaScript code.
Grammar
Property
LANGUAGE Definition scripting language
SRC defines a URL to specify a file that ends with. JS
Windows Object
The top-level object for each HTML document.
Property
Frames[] An
dialog boxes can be divided into modal dialogs and modeless dialogs, the difference being whether users can work elsewhere in the same application until the dialog box is closed. For example: Open a File dialog box is a typical modal dialog box, you
When the browser reads the HTML file, it wakes up the so-called "JavaScript parser" when it encounters the
After this code is run, the browser will complain.
Cause: because the JavaScript parser does not find any of the Var, function,
JavaScript supports regular expressions by regexp classes, for the simplest example:
Copy Code code as follows:
var regapple = new RegExp ("Apple");
It can match the first "Apple" string that appears in a string, and is
JavaScript learning the first JS Foundation
1, javascript Character set:
JavaScript uses the Unicode character set encoding.
Why do you use this code?
The reason is simple, 16-bit Unicode encoding can represent any written language of the Earth
Javascript is a magical language, and its array is just as unique. We should go to its dross, take its essence, summed up the common best practice. If there are errors, please point out.
A JavaScript array is an object of an array of classes that
Implementing class inheritance with Object.create
Here is an example of the official website
Shape-superclass
function Shape () {
this.x = 0;
This.y = 0;
}
Shape.prototype.move = function (x, y) {
this.x = x;
This.y = y;
One, I am a little white
The second half more impetuous, have a good meditation study, farewell to small white. Decisively bought a few books:
Among them, the first to see the "JavaScript mode"-many people think very shi a book. ......
You can see the example directly, it's too much, it's simple.
(function () {
for (var i=0, len=demoarr.length; i
For the For loop, there are a few points to note
I in the For loop still exists after the end of the loop and in
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