STRUTS2 Ajax to verify that the user name exists" Untitled Document
household name:
XML document/user/register. Web effects p/jsp.html target=_blank >jsp Tutorials /user/register_message.jsp
Action. Code
public string Check () throws
This article is using jquery Ajax call WebService to return the JSON array Oh, JSON data is a small lightweight data for web effects, and real-time interactivity is stronger than XML.
JSON data
{' Employee ': [{' Name ': ' John ', ' Sex ': '
Page scroll to bottom auto Ajax get article
The code is as follows
Copy Code
var _timer = {};function delay_till_last (ID, FN, wait) {if (_timer[id]) {Window.cleartimeout (_timer[id]);Delete _timer[id];}return _timer[id]
This articleIntroduce the Get () function first:
Url,[data],[callback],[type]
Parameter description:
URL: The URL address of the page to be loaded
Data: Key/value parameter to be sent.
Callback: callback function when load succeeds.
Type:
Cases
The code is as follows
Copy Code
var ajax = function () {};Ajax.prototype = {Request:function (method, URL, callback, Postvars) {var xhr = This.createxhrobject ();Xhr.onreadystatechange = function () {if
Learning Ajax recently, I stumbled upon a series of articles on IBM's Developerworks, "Mastering Ajax" is very good, not only explained the principles of Ajax, but also on the web of XML, server-related, DOM processing, and so on the principles of a
A UTF8 page requires post data to the GB2312 page, when the Chinese encoding is submitted in accordance with the UTF8, GB2312 the page can not receive. How to achieve, the network search a very good way, but there is a flaw, here one.
1, the form
Ajax File Upload progress bar page: progressbar.jsp Ajax progress BarAjax progress Bar ExampleTo run the progress bar: Server side: Progressbarservlet.java Package ajaxvalidation; Import javax.servlet.*;Import javax.servlet.http.*;Import java.io.*;
Problem analysis
First the container, the first is hidden.
The code is as follows
Copy Code
This div is empty and is used to put the contents of the $.load () into it.
When we click the "View" button,
The Async:false of jquery, this attributeThe default is true: Asynchronous, false: Sync.
The code is as follows
Copy Code
$.ajax ({ Type: "POST", URL: "Path", cache:false,
: Add a timestamp or random number to the link in the AJAX request
Summary of three methods
The code is as follows
Copy Code
1.xmlhttp.setrequestheader ("Cache-control", "No-cache");2.url + + "&random=" +math.random ();3
In JQuery 1.2, you can load JSON data for other domains, such as "myurl?callback=?", by using a callback function in JSONP form. Will jQuery be replaced automatically? To the correct function name to execute the callback function. Note: The code
Using Ajaxmethod can asynchronously invoke the server-side method in the client, simply call the background in JS. cs file in the method, do some JS can not do the operation, such as query the database. Use Ajaxmethod to satisfy a few points:
1. If
The content of ajaxtest.htm on the front page is as follows: The code is as follows:Copy code This Page interacts with the background in different ways Set up a Handler. ashx page in the background as follows: The code is as follows:Copy
The ajax authentication Username. Today we will talk about the method for verifying the username through ajax again. I have written code many times before. Now I am only talking about ideas and not writing code, if you want to find the code, please
// call the database,'Dim pagesize'SQL = "select top 1 * from [pagesize] order by id desc"'Rs. open SQL, conn, 1, 1'Pagesize = rs ("pagesize ")'Rs. CloseIf session ("pagesize") = "" Then session ("pagesize") = 9Dim pagePage = unescape (Request.
There are two files in total. The first file is index.html, which is used to display files, and the second file is processed by the p. asp file and returned to the page.Let's take a look at the results:Below is the page index.html AJAX static paging
In PHP, use my favorite most powerful CURL.The following is the instance code for querying Domain names on www.net.cn.$ Dn = $ _ GET ['dn ']; // domain name, excluding www$ Ex = $ _ GET ['x']; // top-level domain names, such as. com and. cn,
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.