Data type of JavaScript
Number: Shaping, floating point type
String: Character data, JavaScript does not distinguish between individual characters and strings,
Any character or string can be enclosed by quotation marks or single quotes.
Boolean:
JavaScript Getting Started learning the first JS Foundation
JavaScript Getting Started learning the second JS type
JavaScript Getting Started learning the third JS operation
JavaScript Getting Started learning fourth JS objects and arrays
JavaScript
Learn English:
Dom: Document Object model. Document Object Model
Bom: Browser object model.
Note: You can also call the Window object model. (Window object model.)
API: Application programming interface.
Note: Dom can actually be viewed as an
1, Function:
A function is a JS code that is defined once and can be invoked multiple times.
When a function is called by an object, the function is called the method of the object.
function Cssrain (x, y)
{
Code
}
Explain:
Cssrain: For the
ScrollHeight: Gets the scrolling height of the object.
ScrollLeft: Sets or gets the left distance between the left edge of an object and the current visible content in the window
ScrollTop: Sets or gets the distance between the top of the object and
For the type of judgment, JavaScript uses typeof.
Chestnuts:
Console.log (typeof null); Object
Console.log (typeof []); Object
Console.log (typeof {}); Object
Console.log (typeof new Date ()); Object
Console.log (typeof
function QuickSort (arr) {
//If the array has only one number, it is returned directly;
if (arr.length Centernum) {
arrright.push (Arr[i])
}
} return
QuickSort (arrleft). Concat (Centernum,quicksort ( Arrright));
}
$(this).css({"left":Math.sin((ahd*index+ainhd))*radius+dotLeft,"top":Math.cos((ahd*index+ainhd))*radius+dotTop});
Effect Chart:
Analysis Diagram:
In the figure above:
Black: Is the outer container;
Yellow: is a picture that needs to be oval-
by Dknt from Bbs.blueidea.com
Search the search this, find no answer. So I wrote one, a lot of programs around this problem, often artificial to decide where to truncate, too much trouble.
Implementation content: Truncate a section of text
From:JavaEye.com
Note the definition of object classes in JavaScript, using function to define object classes, initializing objects using the new operator
function person (name, age) {
THIS.name = name;
This.age = age;
this.tostring = function () {
From:JavaEye.com
To enumerate the functions of a JavaScript object:
function iterator (obj) {
For (Var, in obj) {
Document.writeln ("" + Property + ":" + Obj[property] + "");
}
}
A simple example (test.js):
function Employee () {
THIS.name =
This Document Object model allows access to all document content and modifications, as regulated by the World Wide Web Consortium (WWW). This pattern is supported by almost all modern browsers.
Most of the traditional DOM features in the Consortium
The Exec method matches a regular expression with a text-search string. Returns an array of results if a match is found; Otherwise, NULL is returned.Grammar
Regexpobject.exec (string);
The following are the details of the parameters:
IgnoreCase is a read-only Boolean property of a regular expression object. It specifies whether a specific regular expression performs a case-insensitive match. , which is created with the "I" property.Grammar
Regexpobject.ignorecase
Global is a read-only Boolean property of a regular expression object. It specifies whether a specific regular expression is to be matched globally. Otherwise it is created using the "G" attribute.Grammar
Regexpobject.global
The
A regular expression is an object that describes the character pattern.
The RegExp class of JavaScript represents regular expressions and string and regular expression definitions, using regular expressions for powerful pattern matching and
This method returns the value of a number rounded to the nearest integer.Grammar
Math.Round (x);
The following are the details of the parameters:
X: A number
return value:
Returns the value of a number rounded to
This method returns the absolute value of a number.Grammar
Math.Abs (x);
The following are the details of the parameters:
X: A number
return value:
Returns the absolute value of a number
Example:
This will return 1/2 square roots; equivalently, 1 over 2 of the square root is about 0.707.Grammar
Math.sqrt1_2
Example:
javascript Math sqrt1_2 property
This will produce the following results:
Property Value is:0.70
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