I. load () method (simplest)
Load (url, [data], [callback])
Url: the address of the loaded page.
Data: Optional. data sent to the server. The format is key/value.
Callback: optional, callback function
1. The simplest application
Copy codeThe Code is
Step 1: import the jquery plugin
Copy codeThe Code is as follows:
Step 2: add the information display area in .Copy codeThe Code is as follows:
Step 3: Add JS Code to the pageCopy codeThe Code is as follows:
Step 4: Process requests in
The effect is roughly as follows:
Javascript uses jquery. Create an Asp.net web project and use NuGet to obtain the latest Jquery version.
The database uses Nhibernate and the Install-Package Nhibernate reference.
The database uses PostgreSQL.
We are all very familiar with tables. Today's CSS makes the layout of tables more and more brilliant. However, in any case, it cannot conceal the rigidity of those packages.
So how can we make those rigid data more readable and available, and make
Let's take a look at a simple piece of JavaScript code returned by jquery ajax.
Code
Copy codeThe Code is as follows: function getReturnAjax {
$. Ajax ({
Type: "POST ",
Http://www.cnblogs.com/wlmemail/admin/%22ajax/userexist.aspx ",
Data: "username =
Today, remote data loading and page rendering are required in the project, and ajax cross-origin requests are not realized until the development stage. I vaguely remember that Jquery has proposed a solution for ajax cross-origin requests, so I
For practice purposes, ajax is required to obtain the values in the List set in the background. I have never touched on it before, so I will study it today.
1. Download the jar package dependent on JSON. It depends mainly on the
Page script:
Copy codeThe Code is as follows: function ajaxSave (URLS ){
// Define a variable to store the XMLHttpRequest object
Var xmlhttp;
// Define a variable to store the response results returned from the server
Var responseContext = "";
If
When AJAX (jQuery) is used for asynchronous data request, to prevent users from repeatedly clicking the button for some reason, we need to disable the request submission button.
Key Points: The attr and removeAttr functions of jQuery are mainly the
Copy codeThe Code is as follows:
Copy codeThe Code is as follows: // The data part to be updated, such as a Repeater, including the paging control;
Copy codeThe Code is as follows: // register the page as Ajax in the backgroundAjaxPro. Utility.
Document directory
Demo-click the search button below to search for Data
In the web development process, we often need to enter keywords on the front-end page for data search. We usually use the search method to display the search results on
Copy codeThe Code is as follows:
// Use ScriptManager in Ajax Extensitons
// Usage example
// Put the code
OnClick = "ibtnFBSJ_Click"/>
// When the page is refreshed statically, The UpdateProgress will be called, but this background
If you use get in IE7 or earlier requests, the URL restriction is easily overlooked (up to 2083 characters ). Therefore, if the URL may be too long, POST must be
In the long journey of front-end development, ajax is inevitable and generally used for ajax requests in the same domain. However, if a request occurs in different domains, the request cannot be executed, and an exception will be thrown, prompting
I will not talk about it anymore.
Action
Copy codeThe Code is as follows: package com. lk. action;
Import javax. annotation. Resource;
Import com. googlecode. jsonplugin. annotations. JSON;
Import com. lk. service. StudentControl;
Import com.
When using ajax, you often need to assemble the input data in the form of 'name = abc & sex = 1'. You can easily complete this work using the serialize method of JQuery!
JQuery ajax-serialize () method definition and usageThe serialize () method
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.