Encode the Url. The front-end JS needs to use this content. In this case, it needs to be decoded. Sometimes there may be such a requirement. I use it in the background:
The Code is as follows:
HttpUtility. UrlEncode (str, System. Text. Encoding.
Jquery short right-click menu compatible with ie6ie7ie8firefoxchrome
The Code is as follows:
$ (Function (){Document. oncontextmenu = function () {return false;} // right-click to blockDocument. onmousemove = mouseMove; // record the mouse
For more information about the connection efficiency of javascript strings, see.
String connection
1. Most Commonly Used + =
I always said that the efficiency of this method is the lowest. Why? Let's take a look at the substantive process of this
Some code can only be implemented in IE, and some extension functions must be used if implemented in firefox.
FireFox also supports the innerText method of IE.
The Code is as follows:
Function isIE (){If (window. navigator. userAgent. toLowerCase (
Website designers often design some small tool classes (widgets) or reusable programs to make pages more appealing and attract visitors. 20 commonly used Jquery tool classes are collected here. These small tools can help website designers and
As we all know, IE8 has opened support for DOM prototype and two new methods of ECMAv5-Object. defineProperty and Object. getOwnPropertyDexcriptor (long words ......), And the two new methods can only be used for DOM. Microsoft's intention to do
The structure defines two layers. One is a translucent background layer, and the other is the primary structure of the pop-up layer, which is set to floating position: absolute; the background layer easily masks all body content. In the left-right
Some compatible writing methods for binding javascript events are well organized. Thank you for binding events.
The Code is as follows:
Var addEvent = function (obj, type, fn ){If (obj. addEventListener)Obj. addEventListener (type, fn, false
Recently, I switched to Firefox and found that clicking the "add to Favorites" link on many websites is invalid. Later I found that the "add to Favorites" method in IE and Firefox is different. The complete code is as follows: there are also prompts
Have you written some repeated code manually? You also think they are so boring. Well, there is a better solution here. This tutorial will show you how to use jQuery to add continuous CSS classes to generate a vivid list. The second example shows
Insert characters in the array and add an array. You can use the slice Method to delete the array. The operation is convenient. This code is implemented by the author through the push and shift methods. It can only be an idea, but this method is not
If event processing is involved when javascript is used, you need to know the differences between events in different browsers. There are three types of javascript event models: NN4, IE4 +, and W3C/Safari. This also leads to differences in event
The only thing you can do is add a bit of beautification to make the user experience more floor-level, including the bold border, focus acquisition, and checkbox border line hiding.
The Code is as follows:
Window. onload = function (){Var price =
It mainly tests the actual processing of the JS engine performance of the array push () method and the directly adding method. The program code is simple and easy to explain.
The Code is as follows:
Var oldtime = new Date (). getTime ();Var
We all know that some initialization actions are required after the page is loaded. For example, you need to run some js effects and set the form. How do you know that the page has been loaded? Generally, the onload of the body Tag is set to listen
Create a new user object and accept an object with many attributes as parameters
The Code is as follows:
// Create a new user object and accept an object with many attributes as a parameterFunction User (properties){// Traverse all attributes
Javascript controls the input implementation code of invalid characters. For more information, see. The html file code is as follows:
The Code is as follows:
Javascript controls illegal character input
The js File Code is as follows:
Inspired by the comments in an alt attribute article of an image yesterday, the author briefly summarized some of the Processing Methods of images on the webpage.
2. automatically zoom out the image
Some images are often large, and the uploaded
The event object of IE browser is different from that of W3C. Therefore, we encapsulate an EventUtil class to make the event object of IE browser the same as that of W3C.
The Code is as follows:
Untitled document
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.