Bind the Click event to an element, but one problem is that the Click event fails when I execute some AJAX requests
For example, my paging is an AJAX request, but when I click on the next page, the resulting element A does not have the Click event.
Objective
Compared to JS, jquery saves us the lengthy code to get elements, without considering some troublesome compatibility issues, more convenient animation implementations, and more convenient method calls that make jquery really more
Using jquery, with Ajax to achieve local refresh, in Firefox, 360 Fast browser high-speed mode, ie8,9 can run normally, but switch to compatibility mode is not valid, there are two ways to close the browser compatibility view, the second is to
As follows:
1: Non-Ajax
Front desk:
Corresponding background:
Ajax of 2:jquery
Before introducing the use of jquery to submit a form, we need to first refer to Jquery.form.js, which comes from http://www.malsup.com/jquery/form/, so we need
It was not used before the error--ajax Jsonp was executed directly. To its understanding of the same as ordinary Ajax request, no in-depth understanding of this error, after debugging (check the background code and JS section of the property
Directly on the code:Reg_ajax.html
ajax request servlet to implement user name validation user name mailbox
The requested servlet code is as follows, Userservlet.java
Package cn.bestchance.servlet;
Import
The effect is roughly as follows:
This piece of JavaScript uses jquery. Create a new ASP.net Web project and use NuGet to get the latest version of jquery.
Database uses NHibernate, Install-package nhibernate references.
The database is used
An encapsulation of Ajax
URL is the address of the request
//successfunc is a function after the success of a request return, there is a parameter, the argument is the return of the server style
function ajax (URL,SUCCESSFUNC)
{
var xhr =
The example of this article tells the thinkphp processing Ajax return method, share for everybody reference. The implementation methods are as follows:
You can return directly using Ajax in thinkphp:
Copy Code code as follows:
$.post
The example in this article describes the way jquery uses $.ajax for instant validation. Share to everyone for your reference, specific as follows:
Use jquery and the general handler to instantly verify that the user entry's number is duplicated
The examples in this article describe two implementations of Thinkphp's return of JSON via Ajax. Share to everyone for your reference. The specific methods are as follows:
Method One:The PHP code is as follows:
Copy Code code as follows:
The example of this article describes the Ajax simple pop-up layer effect of jquery implementation. Share to everyone for your reference, specific as follows:
The screenshot of the running effect is as follows:
The specific code is as follows:
Look at an example of an AJAX query that submits a form with jquery.
Basic function: The user enters a form, enters the admission ticket and the verification code, verifies whether the user enters the form, clicks the query to submit, then obtains
Spent three head, repeatedly check, found that the original is changed processing page return header information.
With the Application/x-javascript, IE8 no work.
If it is text/html, it is OK, or it is not specified.
Is it a bug? Let me say hello to
In jquery, there are three ways to implement Ajax: $.ajax (), $.post, $.get ().
First we look at $.get ():
Copy Code code as follows:
$.get ("test.jsp",
{name: ' Cssrain ', Time: ' 2008/01/21 '},//data to be passed
function (data)
Copy Code code as follows:
Ajax File Downloads
jquery.download = function (URL, data, method) {
Get URL and data
if (URL && data) {
Data is string or Array/object
data = typeof data = = ' String '? Data:jQuery.param (data);
Before using the Artdialog 5.0 version, very admire the author's creativity and professionalism, now the new version of the function toward lightweight JS convenient development, I still prefer artdialog.open before the function of direct
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