More intuitive:
---------------------
For example, var a = 32.6;
VaR B = 67;
VaR c = 9e5;
---------------------
If you want to convert a numeric value to a scientific notation, you can use the toexponential () method. This method accepts a parameter
For example, we want a recursive function to calculate the Fibonacci series. A Fibonacci number is the sum of the first two. The first two digits are 0 and 1.
Copy codeThe Code is as follows: var maid = function (n ){
Return n };
For (var I = 0; I
JavaScript programming language, as the most popular Client scripting language, has long been familiar to many Web developers. With the advent of the Web2.0 era and the wide application of Ajax technology, JavaScript has gradually attracted more
To use this code to access your webpage, you must use a pixel font (PX) instead of a relative font, either "EM" or "% ". Of course, if you use code of other font units, you can easily adapt to this. If the script cannot find the font size of a
Let's take a look at the phenomenon:
Copy codeThe Code is as follows:
apply_and_call
When you click DIV, the pop-up box displays undefined.The reason is that after the DOM object responds to the click event, the this keyword in the event
The definition of a closure is very obscure-a closure refers to a syntax domain located in a specific area with a continuous reference (read/write) section of the non-persistent variable value capability in the execution domain outside the region
I. Syntax
The expression after delete must be referenced by an attribute, for exampleVar o = {a: 1 };Delete o. a; // here, o. a is a reference to attribute a of object o.
A separate attribute name can be used only in the with statement.Copy codeThe
For example
Copy codeThe Code is as follows: a * B + c;
First calculate the Multiplication Side, then calculate the multiplication and division, and finally calculate the addition and subtraction, With parentheses. First, calculate the values in the
Copy codeThe Code is as follows: (function (){
Var urlToObject = function (url ){
Var urlObject = {};
If (/\? /. Test (url )){
Var urlString = url. substring (url. indexOf ("? ") + 1 );
Var urlArray = urlString. split ("&");
For (var I = 0,
About reverse reference
Copy codeThe Code is as follows: // test the Function
Function matchReg (reg, str ){
Var result = str. match (reg );
If (result ){
Console. dir (result );
} Else {
Console. log ('match failed ');
}
}
Var reg =/([A-Za-z] {0, 6
Copy codeThe Code is as follows :/*
* Time Difference obtained, in the format of year-month-day hour: minute: Second or year/month/day hour: minute: Second
* The year, month, and day are in full format, for example, 01:00:00
* Return accuracy:
There are three main methods
Conversion functions, forced type conversion, and weak type conversion using js variables.
1. conversion functions:
Js provides two conversion functions: parseInt () and parseFloat. The former converts the value to an
Here is just a pure setup, even the environment is not available, but what server-side js is playing, everything has become a floating cloud, let's first build an environment, enter a "hello world" page.
Yes,
Build Windows 7You only need to follow
All content is as follows:
2010.11.291. [window.] alert ();Document. alinkColorTextString. anchor ()Navigator. appCodeNameEscape ("Hi! ") Returns the ascii code.Eval ("x + y") Evaluate the string x = 10, y = 20; eval = 30FormName. elementName.
The most distinctive and confusing function in javascript is regarded as a function.
Next, let's take a look at common operations.
Copy codeThe Code is as follows: function doit (){
.....
}
Doit ();
Functions in javascript can be used as
Before learning about javascript inheritance, you must first understand the following concepts:
Parent class: inherited class
Subclass: inherited class
Superclass: that is, the parent class
Abstract class: a class that is generally not instantiated.
Clip first:
Background image:Floating cloud image: yun---------- here is the image D ~ You can see all the options (because the background is white and the cloud is white ~)......CSS code:
Copy codeThe Code is as follows:
Understanding:. hScroll
This article is translated from 5 Reasons Your Javascript Stinks.
Javascript has a bad reputation on the Internet, but it is hard for you to find another language that is so dynamic, so widely used, and so rooted in our lives. Its low learning
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.