Later in a humble station to find a post, a person's a suggestion to remind me.
My original code was written like this:
Error code
Copy Code code as follows:
$.ajax ({
Type: "Post",
URL: "_service.asmx/getdatafromatable",
Data:
Copy Code code as follows:
var parambeanlist = new Array ();
Array.prototype.addparambean=function (parambeanobj) {
var index = This.containparambean (parambeanobj);
if (index!=-1) {
This[index] = parambeanobj;
} else {
This.push
Hi, two today, do something, ah, remember, just the first two days have been learning Ajax-related knowledge, and then learn about jquery and Ajax related knowledge.
1, JQuery
-----jquery and Ajax-----
Ajax, "Asynchronous JavaScript and XML"
In doing Ajax pages without refreshing add, ie encounter ajax cache, because the beginning does not know IE has this bad, toss for a long time, finally solve the problem.
summarize the solution :
Using AJAX to request a page under IE, usually
Query Formvalidator plug-ins are very useful, but there is a serious bug, in the use of AJAX verification, if the contents of the input box already exists, put the mouse into the input box, do not make any changes to leave, it will prompt the error,
Do not want to use the style of Easyui, but want his form function, originally was to go to the Internet to find relevant plug-ins, but did not find it began to write their own, did not think so simple.
Background code: (This is not important)
in the Web development process, we often need to input keywords in the foreground page for data search, we usually use the search method is the search results on another page, such a way to build high-performance Web site is not the most appropriate,
It's very rare to use JavaScript to implement page functionality in the first place, but the idea has changed since you learned about jquery; With such a script component you can easily and HTML isolate it when writing scripts, which makes it easier
JS to cross the domain, you can use:
is able to read data from other sites," he said.
The key is to see your spirit is not flexible, will not use.
Ajax to cross domain, you can use the server to other sites to take content, such as asp.net:
Today in the project to do the remote data loading and rendering the page, until the development phase to realize the problem of Ajax Cross-domain request, vaguely remember jquery has mentioned an AJAX Cross-domain request solution, so immediately
Not much to say, directly paste code:
Here is the JS section:
Copy Code code as follows:
var pageSize = "10";//number of rows per page
var currentpage = "1";//Current page
var totalpage = "0";//Total pages
var rowcount = "0";//total
Let me just briefly talk about the implementation process:
1. Find the link source, I am here is a string of li under the link
2. Processing style
3. When the mouse moves to load the site of the link source to the specified container, and toggle
Looked at the CI page class did not write about Ajax content, but also saw several other great God wrote the page class extension, it is not really necessary.
Making a small change on the existing basis is still achievable.
Let's get down to
The page to update
Copy Code code as follows:
Phase I Phase II Hello
Action Page
Copy Code code as follows:
protected void Page_Load (object sender, EventArgs e)
{
if (request.params["data").
jquery Ajax asynchronous request receive return JSON data method Setup is simple, one is the server handler is to return the JSON data, the other is the AJAX send settings datatype set to JSONP format data or JSON format can.
The code example is as
Through jquery's built-in AJAX capabilities, direct access to the background to obtain JSON-formatted data, and then through the Jquer data binding to the previously designed HTML template, directly on the page display.Let's look at the HTML
Request data
We can use GET, POST two ways to request data backwards, here in PHP, for example, suppose there is a test page age.php, used to return age information, the content is:
if (isset ($_request[' name ')) && $_request[' name '] = =
Load syntax
$ (". Selector"). Load ("url", function (ResponseText, statustext, XMLHttpRequest));
Can do to load a page, if there is an error, according to the state given by StatusText, show the corresponding prompts, this is very important to
A common effect, when using AJAX requests, is not to return before the occurrence of a rotating loading small icon or "content loading ..." to inform the user is requesting data. This can be achieved using the Beforesend method.
Download Demo:ajax
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