Toggle (fn, fn2, [fn3, fn4,...])
Call the function after each click.
If a matching element is clicked, the specified first function is triggered;
When you click the same element again, the specified second function is triggered. If there are more
We want to implement the circle effect like Google + without using images. Here we only use CSS3 and JQuery, first define CSS:1: Introduce JQuery:1: 3:4: Target HTML segment: developers code Okay, this is the case after exercise:
You may
If you obtain the "current" Domain Name
Host = window. location. host;
Url = document. domain;
Url = window. location. href;
Obtain the complete url path: Use the following code to complete the certification result:
ThisDLoc = document.
Chaotic URI EncodingThere are three methods for encoding in JavaScript: escape, encodeURI, encodeURIComponentC # encoding methods: HttpUtility. UrlEncode, Server. UrlEncode, Uri. EscapeUriString, Uri. EscapeDataStringThe JavaScript code is okay.
Visible area width of the webpage: document. body. clientWidthVisible area height: document. body. clientHeightVisible area width of the webpage: document. body. offsetWidth (including the width of the edge)Visible area height of the webpage:
Introduction:Recently, I encountered a problem and referenced the jquery library and another js library. When $ XX is used to call the js library function, it becomes invalid! So I found the document. It turns out that jquery has a name conflict.
/* Function definition */Function a () {return 1 ;}
Var B = function () {return 1 ;};
Var c = function d () {return 1 ;}; // d === undefined
Var e = new Function ("return 1 ;");
Alert (typeof a); // functionAlert (typeof B); // functionAlert
Z's Code determines that the IP address is killing me. Things like sun, shit, REMOTE_ADDR, HTTP_CLIENT_IP, and HTTP_X_FORWARDED_FOR are too detailed in the manual and basically no.Gg found out one thing on the Internet. In addition, there was a
Jquery1.4. After the event is bound, m will be overwritten. The two events point to the final object, as shown in the following situation:
Function pop1 (){Var obj = {M: "2 ",Fn: function (){$ (Window). bind ("resize", $. proxy (this. pop, this ));}}
This function can be used directly to merge the situations where the upper and lower cells have the same value. Effect:
I have written comments. You can understand the comments, but they may not meet your requirements. But you can modify the
I. Principle:In view of the fact that we have recently completed a front-end xml data verification, found some information, and made some summary, and wrote a simple xml string verification function, the implementation process is mainly to parse the
JavaScript does not have a class, but it is simulated using a function closure (closure). Similar to the class in C #, it is called an object in js.[Javascript]1. function Person (name, age) {// declare an object, similar to a class defined in C #2.
An anonymous function is a function without a name. For example:Function (){Alert ('a function ');}However, the above Code will report an error. Firebug prompt: function statement requires a name, that is, the function must have a name.
The strange
Window objects have two main timing Methods: setTimeout and setInteval. Their syntaxes are basically the same, but their functions are different.The setTimeout method is a Timer Program, that is, after what time. After the job is finished, pull it
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