Jquery + ajax sends request data to the background every second and then returns the page (including the method for executing the jquery page after loading)
The Code is as follows:
This article mainly introduces the example code of JQuery + Ajax without refreshing pages. If you need it, you can refer to it. I hope it will help you first:
The implementation principle is very simple. The jquery. pagination plug-in is used. When you click the page number, the data on the page is asynchronously ret
the server. Automatically converts to a string if it is not already a stringExpression The GET request will be appended to the URL. To prevent this automatic conversion, you can view the ProcessData option. The object must be a key/value grid, for example {foo1: "Bar1", Foo2: "Bar2"} is converted to FOO1=BAR1FOO2=BAR2. If it is an array, jquery will automatically be a differentThe value corresponds to the
Copy Code code as follows:
function Verify () {
var jqueryobj = $ ("#username");
var username = Jqueryobj.val ();
var url = "Servlet/userinfo?username=" + encodeURI (encodeURI (username));
var url = "Servlet/userinfo?username=" +username;
Note here because IE uses caching technology, for the same URL, only the first time back to call the background, the next access is this cache
Here wit
Http://www.killuakun.com/post/jquery-aspnet-ajax-web.aspx
This is my most recent training course to show my colleagues how to use jquery and ASP. net3.5 to develop Ajax Web ApplicationsProgram", I think the program and content are easy to understand. I will share it with you.
1. Why
The user enters a form, enters the admission ticket and verification code, verifies whether the user enters the form, click query and submit, and then obtains the returned data from the server and displays an example of submitting a form ajax query using jQuery.
Basic Function: enter a form, admission ticket and verification
This article mainly introduces jQuery's simple AJAX pop-up layer effect code, which involves jQuery's skills for responding to mouse events and dynamically operating page elements to achieve the effect of the pop-up layer. it has some reference value, if you need it, refer to the example in this article to describe the simple AJAX pop-up layer implemented by
When I first came into contact with Jquery last year, I used the interface special effects. I am very interested in it. Due to the fact that Jquery is not very useful in projects, I miss it very much, don't take some time to look at Juery's fun stuff. Function Description: The main function is to display data by page. You can configure the page number to be displayed on each page in the configuration file.
:"GET""script"});Second, $.getjson () method
This method is used to load the JSON file
If the URL of the request includes "callback=?" And so on, jquery automatically sees it as a JSONP and executes the corresponding callback function to get the JSON data.
The function is to load the data asynchronously .
The function belongs to the global
The most basic ajax interaction code: json cross-origin transfer between jquery and java, and return of java json code, jqueryjson
First import the jar package
The jar package above is mainly used to convert map or list data into a json string and pass it to the foreground for use.
Static Page
Before we summed up the jquery plug-in development of the two ways, here on the practice, do a little praise special effects plug-ins, first look at the effect bar:
Nonsense less to say, on the code:
Extended object Point-and-click Plug-ins, point-praise effects ***////***zynblog**////***2016-5-11**////*** usage: jQuery ('. praisebtn '). Praise (options);
function if(Jquery.isfunction (params)) {//We assume that it ' s the callbackcallback =params; Params=undefined; //Otherwise, build a param string}Else if(Params typeofparams = = = "Object") {type= "POST"; } //If We have elements to modify, make the request if(Self.length > 0) {Jquery.ajax ({url:url,//If "Type" variable is undefined and then "GET" method would be used. //Make value of this field explicit since //user ca
Background
In a new project being developed by our department, we chose jQuery as the basic Javascript function library. The ajax methods provided by jQuery are also determined as the basic interface for asynchronous push-pull data.
Colleagues who have used ajax methods should know That
The Ajax GET request code for the Javascript/js is as follows:
Javascript/js POST request for Ajax:
Note: XMLHttpRequest is the basis of Ajax, and when creating XMLHttpRequest objects, you must be in the same ' ' tag as the
The Ajax () method loads remote data through an HTTP request.
The approach is the jQuery-bottom AJAX implementation. Simple and easy-to-use high-level implementation see $.get, $.post, etc. $.ajax () returns the XMLHttpRequest object that it created. Most of the time you do
). FIND ("id"). Text () + "" + $ (a). Find ("value"). Text ());});}catch (e) {Alert (e);Return}},Error:function (result, status) {//If no above catch error will execute the callback function hereif (Status = = ' Error ') {alert (status);}}});});});
Ajax provides feedback to users, using the Ajaxstart and Ajaxstop met
of the front-end, according to the submitted image ID value, find whether the IP table has a click record of the user's IP, if there is a tell the user has "liked", conversely, then do a bit:1. Update the value of the image Love field in the Picture table, and add the value 1.2, the User IP information is written to the Pic_ip table, to prevent users from repeating the click.3. Get the updated love value, that is, the total number of users who like t
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.