Chapter 9: event 1. DOM event stream Dom supports two types of event models: Bubble event and capture event. bubble events: events are triggered in the order of the least specific event targets. capture event: the opposite process. 2. event
Original article: http://www.cnblogs.com/donghongtao/archive/2010/10/12/1848640.html
function getdatediff (starttime, endtime, difftype) {// convert the time format of XXXX-XX, format: starttime = starttime. replace (/\-/g, "/"); endtime =
With the prototype feature, you can easily inherit the methods and attributes of the parent class in the subclass.
In the following example, vegetable is treated as the parent class, and celery is treated as a subclass.
Vegetable has the property
Dom node type, which is useful in traversal and can be used to filter nodes that do not care about.
For example:
Function showpageattr () {var divimgshowarea = document. getelementbyid ('divimgshowarea '); var nodes = divimgshowarea. childnodes;
There is a form in showmodaldialog. It is easy to use JavaScript to directly close this window after the user submits this form. However, after debugging for a long time, although the original window is closed, however, a blank window is always
What is FSO?
FSO is a file system object. It is a technology used to list windows disk directories and files and delete, create, copy, cut, and move directories and files. Benefits of using the FSO Website: directly read files and subdirectories
Preface:
Some time ago, we tested the following special symbols. The javascript code is as follows:
['~! @ # $ ^ & * () = | {};: '"., [\]./? ~ @ # & * {}]
The result shows that \ cannot be matched, so the code is corrected
['~! @ # $ ^ & * () = | {}
In the early stage, system operations were performed under. net, and the implementation of the same functions was very complicated. I didn't expect JavaScript to be so simple, so I searched the code online and improved it.
Function pathlist (PATH)
Win32_processor // The CPU processor win32_physicalmemory // The physical memory win32_keyboard // The keyboard win32_pointingdevice // The vertex input device, for example, the mouse win32_diskdrive // hard drive drivers // disc drive
JavaScript Object definition method
1. var OBJ = new object ()
New Document
2. var OBJ = {};
New Document
You can also initialize the value at definition:
VaR OBJ = {key: '11 '};
How to convert an object to a string
If you directly
Preface
HTML itself has event-triggered attributes, such as onclick, onmouseover ,.....
View Code directly (Note: This document uses onclick as an example)
New Document
This example is simple, but if the following conditions occur:
1. The onclick
JS Data Type
Before introducing the differences between the three, let's take a look at the JS data types.
In a language such as Java and C, before using a variable, you must first define the variable and specify its data type, which is an integer,
First, describe the webpage effect I want to make. Basically, after placing the mouse over the image, the scroll mouse pulley can zoom in and out the image, after you press the mouse, move the mouse to move the image. You can see the specific
Yesterday, I saw a post "so, you think you know JavaScript?" In the blog of baranovskiy, a famous front-end architect.
Question 1:
if (!("a" in window)) { var a = 1;}alert(a);
Question 2:
var a = 1, b = function a(x) { x && a(--x);
Defer attribute in script
If you are a person who cares about and cares about system performance, I think you should be interested in defer in the script.
The defer attribute in script is false by default. According to the descriptions in the DHTML
In JavaScript, array is also an object, but some people may mistakenly think that access like a ['key'] is an array function, not actually.
In the following example, after an array value is assigned, its Length attribute is still 0, because the
In JavaScript, you can use the charcodeat () function to obtain the character code.
Otherwise, you can use string. fromcharcode () to obtain the characters in the code.
Application 1:
Base64 encoding. Use the charcodeat () function.
Application 2
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