After the pop-up layer, the tab key can also be operated on the page, which leads to a script error. So what if we want to avoid this situation? The following small series will introduce how to solve this problem. In some web pages or in the pop-up
The following code encapsulates the form elements in a page container into a json object
The Code is as follows:
(Function ($ ){$. Fn. serializeObject = function (){Var inputs = $ (this). find ("input, textarea, select ");Var o = {};$. Each
This article provides a detailed description of the onclick event parameter passing in js. If you need it, you can refer to it and hope to help you.
1. There are two methods to pass parameters to a method on the page.
1: onclick = cancel (id,
JQuery plug-in development sample code
JQuery plugin development:Class-level development to develop new global functions
Object-level development: develop new methods for Jquery objects
I. Class-level development-define a global Method
The Code is
ZTree plug-in multiple select drop-down menu instance code. For more information, see.
ZTree plug-in Multi-choice drop-down menu instance codeCss and js
The Code is as follows:
If you want to implement a drop-down list box that can be selected and input, the following is a good example.
The Code is as follows:
Drop-down list box that can be selected and Input
OnChange = "javascript: document.
In jquery ajax, if we want to implement synchronization or Asynchronization, we can directly set async to true or false to truefalse, example 1: jquery + ajax/"target =" _ blank "> jquery ajax Synchronization Method
The Code is as follows:
$. Ajax
Jqueryajax does not significantly change the processing of json data with other ajax data. We only need to simply process the data type of the ajax ype In the ajax section as json. Let's look at an official example.
Use AJAX requests to obtain JSON
In jquery, if we want to obtain the selected checkbox, We can input: checked, and then we can use jQuery's size () to obtain the number of selected checkboxes () the method or length attribute can be used to determine the result. Previously, I used
There are many methods to retrieve the elements in iframe. This article introduces how to obtain the elements of the parent page on the iframe subpage. Below is a good example, if you are interested, refer to the following section to obtain the
Js does not have the in_array function, but we can write an in_array function for js. In js, we cannot directly judge a value or string as in php and use in_array in the array, because js does not have the in_array function, but we can customize it
Paging code written in pure js is concise and practical! For more information, see.
The Code is as follows:
// The number of words displayed on each pagePageSize = 5000;// Paging ModeFlag = 2; // 1: Automatic paging Based on words 2: Paging based
The three instance methods for closing the pop-up layer have a pop-up layer in the development and application. Sometimes we have a close button, so that you can click Close to close the pop-up layer, but sometimes I want to automatically close the
The javascriptalert garbled solution javascript alert () function is a function used to input prompts. However, Chinese characters are garbled During alert () prompts today, and there is no problem with pinyin or anything, I will find a solution in
Javascript special character escape. For more information, see.
Point escape:. ==>\\ U002E
Escape of dollar signs:$ ==>\\ U0024
Escape of the multiplication symbol:^ ==>\\ U005E
Escape from the left braces:{==>\\ U007B
Escape the left square
Some webmasters may notice this effect, and the new message will flash the title prompt. The following is a good example of how the new message will flash in the webpage title, if you are interested, you can see that some webmasters may notice this
Background color, such as changing your mood, you need to remember this state. The following describes how to use cookies to remember the background color. Do not miss out if you are interested.
The Code is as follows:
This article introduces the sample code for controlling different css styles in different time periods in Javascript. If you need it, you can refer to the js function and put it in a separate js file or on the current page.Within tag
The Code is
A namespace creates a global object for a project or library and Adds all functions to the global variable. By reducing the number of global variables in the program, you can implement single global variables without causing global pollution when
The framework page is updated automatically. When index.htm is refreshed, the script is automatically called every second to refresh the framework Page code. The specific implementation is as follows. If you are interested, you can find
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