The keyCode table on the Javascript keyboard. You can save a copy of the table.
1. Key Value of the letter and number key (keyCode)
Buttons
Key code
A
65
B
66
C
67
D
68
E
69
Now our motherland has risen .. the computer configuration is also on the rise. however, the performance of js cannot be underestimated .. especially in Internet Explorer .. the js engine speed is inherently slow .. if Javascript is hard to be
Js controls div and related attributes. For details about elements on the page, refer. Dynamically create DIV: var p = document. createElement ("p ");
Set p attributes and styles:
P. title = "this is a new p .";
P. class = "newDivClass ";
P.
Javascript forces a new window to pop up, mainly by using dynamic creation of links.
function openNew (url) {var NewInf = document. createElement ('A'); NewInf. setAttribute ('href ', url); NewInf. setAttribute ('target', '_ blank'); document.
In general, Chinese garbled characters are solved using js combined with escape, but the following method is some problems in the background. Pay attention to the output sequence. It is a good habit to declare the encoding type in the output content
Some tips under js. If you need them, you can try them.
1. javascript to get the URL "? "Following parameters:
Var query = window. location. search. substring (1 );
Var pairs = query. split ("&");
2. The default function of IE browser is
Determine the time based on the mouse: Js countdown program. If you move the mouse out of this page, the countdown will stop. Move the mouse over and start immediately. It's interesting.
determine the time based on the mouse: Js countdown 0)
Event. srcElement can capture the objects of the current event. For example, event. srcElement. tagName can capture the activity tag name. Note that all obtained tags are expressed in uppercase, such as "TD", "TR", and ". So you can copy some of the
Because browsers such as Firefox and IE have different methods of interpreting JS, obtaining the mouse position under Firefox cannot be obtained directly using clientX. Generally, the Internet only triggers the mousemove event. I have two sections
When you know the value of a selectoptions, determine whether the options Value of the current select statement is the same as the known value. Generally, users modify pages.
The Code is as follows:
Funtion setSelectOption (a, B) {// a =>
The basics of javascript syntax are common issues in general. It is suitable for friends who have other program basics. 1: javascript case sensitive
2: Each javascript statement must end with ";", which is the same as the C language.
3: Output:
There are a lot of operations on the page. We need to display the results of each operation. Here we have a question: how should we display different results?
Problem:
There are a lot of operations on the page. We need to display the results of
Analysis of ajax onreadystatechange support in firefox. For more information, see. I. Problems:
The Code is as follows:
Var xmlHttp;Function savecarttodata (){CreateXMLHttpRequest ();Var rndcode = new Date (). getTime ();Var CartUrl = "a. asp?
When AJAX is used for interaction between the server and the client, the common practice is to let the server return a JSON string and parse it into a JavaScript object on the client. The method used for parsing is generally eval or new function.
The package set is always oriented to the set. For more information, see. I think this is easy to understand. The JQuery object encapsulated by $ () always appears in the form of a set, even if there is only one object in the packaging set.
The
Sort out some parameters of the execCommand command in dom. For more information, see. 2D-Position allows you to move an absolute position object by dragging it.
AbsolutePosition: Set the position attribute of the element to "absolute" (absolute
This is a very simple js object-oriented instance code, mainly used. For js object-oriented learning materials, you can view previous articles in the script house.
script function user () {this. age = 21; this. name = "zhangsan"; this. say =
Obtain the element and mouse position (compatible with IE6.0, IE7.0, IE8.0, FireFox2.0, FireFox3.5, and Opera). This function was developed by a colleague of mine, the goal is to implement functions similar to QQ custom layout and drag-and-drop
Today, we will show you how to use the JQuery framework to load and display data read from XML files for Blank HTML documents. We will mainly use the built-in JQuery process $. get. Preparations
Before starting, we need to make the following
This is generally used to enhance the search function and increase the user experience on the Internet. The auto-Prompt function is required in work. Haha, I am a js dish, So Baidu finds a plug-in developed with jquery AND ITS autocomplete. net
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