There are a lot of scenarios for event listening in js. It is nothing more than determining whether the browser supports addEventListener and attachEvent. There are many methods to search for event listening on the Internet, but there are still some
In the past, we briefly talked about how to obtain url parameters in js. This article describes how to obtain, set, modify, and parse js url parameters.
Obtain url parameters
The Code is as follows:
Copy code
The core
I want to write a common JavaScript Regular Expression Code for a friend. I have sorted out some of the following code for reference.
Match the ending numberSource: how to use a javascript Regular Expression to retrieve the last number of strings?
This article will introduce how to compare objects in JavaScript.
In JavaScript, it is a little troublesome to compare the members of two objects. If it is only the first layer, it is easy, but the attributes in the sub-object may be an object, so
Next, I will introduce you to a simple implementation method of disabling pop-up by right-clicking the IE browser menu. For more information, see.
Add the oncontextmenu event to the tag. To prevent event propagation and prevent the system from right-
We usually use the length function to calculate the character length in js. However, it is strange to read the document written by a friend below, the following describes how to calculate the length of a null character or a string.
You can use the
This article will detail the bugs and Solutions of the setMonth method of the javascript Date object. For more information, see.
In fact, I can't talk about any bugs, but the JS Date object handles the overflow time.
First, set your system time to
Yesterday, a friend asked me what Javascript var p = function () {} () means? The following is an example of the meaning and use of this function.
The Code is as follows:
Copy code
Var p = function (){}();
What does
This article will introduce you in detail a jquery code compatible with the ie6 instance on the top of the suspended page after scrolling to the navigation bar. For more information, see.
Jquery Implementation Method
The Code is as follows:
A good picture switching effect that can be used to discuss automatic playback with cache effect. You may want to know more about it.
The Code is as follows:
Copy code
automatic playback-slide Buffer Effect
Js to get the page height and width, we can use document. body. offsetHeight (including the height of the edge) and document. body. offsetWidth (including the edge width) is enough. The specific example is as follows.
View the difference using the
This article will introduce the dijit. form. DateTextBox date automatic conversion method in js. I hope some methods will be helpful to you.
After investigation, we can use the following code to solve the problem.
The following code:
The
In js, we can use the length function to determine the length of common pure letters and numbers. However, we may not be very accurate about Chinese characters, below I will add some related instances to your favorites.
For example, use the length
Today, I will introduce you to the principle of an array sorting sort method in js. I hope this method will be helpful to you.
Recently, Baidu projects used to sort arrays. Of course, at the beginning, we naturally thought of the array sort method.
Window. location. href is a jump function in js. However, we found in ie6 that window. location. href cannot be redirected. The following describes the causes and solutions.
The problem code is as follows:
The Code is as follows:
Copy
Because javascript is a weak type of language, and everything in javascript is essentially an object, it is not easy for us to directly determine whether the object is an array, next, I will sort out the implementation methods for js to determine
We will introduce how to insert content at the specified position in the Editable div, just like the editor we are using. Below I will introduce several instances.
First, enable the edit mode for the DIV.
The Code is as follows:
Copy
Yesterday I made a simple project and required a select menu with three levels of linkage. However, IE6, which cannot afford to be hurt, encountered a select bug that cannot be hidden, I have also introduced the select layer-high issue in IE6, which
AjaxThe most convincing reason for using JavaScript frameworks is to standardize Ajax requests across browsers. An Ajax request is an asynchronous HTTP request. It sends a request to a server script and returns a response, such as XML, JSON, HTML,
Use Jquery to implement editable tables and submit them to the server to modify data using AJAX.
Below is the js Code:
Copy to ClipboardReference: [www.bkjia.com] $ (function () {// equivalent to adding an onload event to the body tag on the page
$ (
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