Let's briefly introduce the basics:
First, window.open () Support environment: java1.0+/j1.0+/nav2+/ie3+/opera3+
Second, the basic grammar:
window.open (Pageurl,name,parameters)
which
Pageurl as a child window path
Name is a child window
So the basic things should not be recorded, but, restudying ~ first from the data type
JS Six data types: number, String, object, Boolean, null, undefined
String: Single or double quotation marks, such as "string"
Number: What integer AH floating
There are three methods of obtaining elements in javascript:
1, getElementById () method: Get the HTML element by ID.
2, Getelementsbyname () method: to get the element by name, is an array.
3, getElementsByTagName () method: The HTML tag to get
But parseint ("08", 10) can return 8.
To find out the difference between the two,
Refer to the difference written by others: Parseint&number
parseint
Parses a string argument and returns an integer of the specified radix or base.
Core
These ancient browsers only support a method of registering event handlers, a method that was invented by Netscape. Because Netscape is preemptive, if Microsoft wants to be a browser that supports JavaScript events, it has to follow Netscape, so
The JavaScript array is essentially an object that converts the subscript of an array into a string and uses it as a property, so it is significantly slower than a real array, but it can be used more easily.
Change oneself
three ways to affirm functions (declaring a function)
Method One: function functionname ([parameters]) {functionbody};
Example D1
Copy Code code as follows:
function Add (A, B)
{
return a+b;
}
Alert (Add (1,2)); Produces 3
Sometimes there may be such a demand that I use in the background:
Copy Code code as follows:
Httputility.urlencode (str, System.Text.Encoding.UTF8);
The URL is encoded, the front desk JS need to use this content, this time
Normally, window.onload is sufficient, and if you want to load multiple events, we can do the following:
Copy Code code as follows:
Window.onload = function () {
Func1 ();
Func2 ();
Func3 ();
More load events ....... ......
}
If you don't know why, don't worry too much, study CSS rules and view this article: use CSS to fix everything: 20 + common bugs and fixes.
If this is not the case, you can fix it with the 12 JavaScript solutions listed below, so that your Web page
Javascript does not have private, public access to the keyword set, but can be a certain skill to simulate the same results.
First let's look at the following line of code:
var i = (1, 2, 3, 4, 5);
The final result of the variable i is 5.
This is
JavaScript is indispensable to WEB development and design, whether it is a simple Web page or a professional site, and whether you are a master or rookie, now the JavaScript library is more and more powerful, can do many complex work, but at the
about what is anonymous function, and its advantages in this article is not delve into, first throw a common anonymous function:
(function () {alert (' Yo ')}) ()
Many students know how to use this anonymous function, but may not understand why it
In JavaScript, arrays are not stored directly as cookies (PHP can), and that is to dump the array into a string, and then save it in a cookie, and we can use either ToString () or join directly on the simple one-dimensional array:
The ToString
When we transmit parameters, we often encounter parameters that send some of the same attributes to the background, and the best option is to use arrays. When we transfer to the background, we simply define and use the array in JavaScript and pass
Believe that every developer knows the importance of caching. There is a cached background (Memcached,xcache, etc.) from beginning to end. ) to reduce the pressure on db. In the Content distribution network (CDN) cache, you want your browser to
The following excerpt the source code, in-depth analysis of his design to achieve the idea:
Copy Code code as follows:
function Format (string) {
var args = arguments;
var pattern = new RegExp ("% ([1-" + Arguments.length + "])",
Someone asked a JS question:
Copy Code code as follows:
var i = 0.07;
var r = i*100;
Alert (R);
The result is 7.0000000000000001?
Check the data, in fact, we know that in Javsscript, variables are stored without
First introduce JavaScript API files
This API provides a total of 6 interfaces, Geoip_country_code () {Country Code},geoip_country_ name () {Country name},geoip_city () {city name},geoip_region () {Region code}, Geoip_latitude ()
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.