Take a look at the code below, what is the last alert?1 var name = "Bob"; 2 var nameobj ={ 3 Name: "Tom", 4 showname:function () { 5 alert (this.name); 6 }, 7 waitshowname:function () { 8 setTimeout
Always get dizzy by the Clientx,offsetx,screenx,pagex of JavaScript's event object, so I decided to make a diagram to distinguish it (drawing my hand that acid ...). )First summarize the following differences:Event.clientx, Event.clientyThe x, Y
To manipulate the form, we first need to know how to get the form reference, which can be obtained in the following ways.Get a reference to the form before you start programming your form, you must first get the form The reference to 1)
When you use the code to real snake game, is a very fulfilling thing. At the same time in the process of writing is also his own basic JavaScript grammar review and experience.Here is the code and some code comments:(bug yes, browser compatibility,
1. Add an Event"Basic Registration methodid= "info">click me! Button >var span = document.getElementById (' info '); Span.onclick = function () { alert (1);}This method can only register one processing function for each event type, and the latter
1. Note:true // This creates a property named " -1.23" // This 1001st element of the array // Array index 1. Same as a[1]2. Delete operator produces sparse array3, set the length of the array will automatically cut off or add undefined4.javascript
Original digest self of front-end blog, welcome everyone to visithttp://hacke2.github.io/CauseA year ago when writing Management College, then do the home page has a slide, because before the exchange, CL static page slide picture is in the
First Class:Second Category:Referencing CSS files on other Web sites with a style tagThe CSS file contains the cross-site program.body{Background-image:url (' Javascript:alert (); ');}Third Category:Class Fourth: Mouse into the region to perform
First look at an example:
var name = ' laruence ';
function echo() {
Alert(name);
var name = ' Eve ';
Alert(name);
Alert(age);
}
Echo();
What is the result of the operation?The above question, I believe there will
Example of JavaScript arguments object application
Arguments object
In function code, the special object arguments can be accessed without explicitly specifying the parameter names.
For example, in the sayHi () function, the first parameter is
Summary on cross-browser compatibility between css and javascript
I. CSS style compatibility
1. FLOAT closure (clearing float)
In some browsers, the webpage is often displayed incorrectly because float is not actually closed, which is also one
JavaScript obtains the coordinates when the mouse moves (compatible with IE8, chome Google, Firefox), ie8chome
JavaScript obtains the coordinates of the mouse movement (compatible with IE8, Google, Firefox, and Opera ).
Directly copy the file into
A simple jQuery code that returns the top
This article demonstrates jQuery's return to the top. When the article page is relatively long, you can easily return to the top of the website, and it is not difficult to implement code!
Call code:
Android: parses Json data
JSON (JavaScript Object Notation) is a lightweight data exchange format. when accessing the server, the returned data is often HTML, XML, and JSON. In this case, we need to parse the data. JSON has two structures: object
Jquery method for getting the attribute values of subnodes and current nodes, jquery attribute values
This section describes how to obtain the attribute values of subnodes and current nodes by jquery.
data management
Child Nodes:
$ (".
Use the typeof Method to Determine the undefined type, typeofundefined
For JavaScript to determine the undefined type, the typeof method is used. typeof returns a string, where one is undefined.
Js determines the undefined type
if (reValue==
JQuery CSS () method to change the existing CSS style sheet
The CSS () method is used to change the existing CSS style sheet. The css () method is diverse in usage. There is one type that can accept two input parameters: style attributes and style
JavaScript-variable and scope chain, javascript-Variable
JQuery snippet:
1 var
2 // Will speed up references to window, and allows munging its name.
3 window = this,
4 // Will speed up references to undefined, and allows munging its name.
5
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.