Recently in the use of ExtJS to do projects, in the loading of data is particularly large when loading timeout phenomenon, under the FB view, the original is ext default Ajax request 30 seconds.
Search the following solution online for reference and
First, when we are validating the form, in order to prevent the wrong also sent to the server, we usually set this:
$ (function () {
var isusername; (set a variable)
var ispwd;
$ (' form '). Submit (function (e) {
if (!
The example of this article for everyone to share the AJAX implementation of remote communications for your reference, the specific contents are as follows
First File: HTML
Ajax solves Cross-domain problems
Second
In modern Web applications, front-end code is flooded with Ajax requests, and if you can use browser caching for AJAX requests, you can dramatically reduce network requests and increase program response speed.
1. Ajax Request
The jquery framework
What is Ajax?
Ajax (Asynchronous JavaScript XML) is able to refresh local Web page data instead of reloading the entire Web page.
How do I use Ajax?
The first step is to create the XMLHttpRequest object, var xmlhttp =new XMLHttpRequest (); The
Use the Watercress API to get pagination results. Equivalent to the results obtained from the background database. The difference is that you can't know the number of pages in advance. Although the total number of pages can be obtained through the
To achieve the function, upload pictures can be previewed, because there are other text, so not only upload pictures, to achieve with other text to save, of course, upload pictures, and then the path and other text to write the database, but also to
The last two months to visit Google's old ventilation, also 8 know what the great gfw made of what means. Although the form is not optimistic, still see the dog released Google AdSense API and Google search Ajax API, the latter is obviously more
This example for you to share the jquery Ajax File upload Instance source code for your reference, the specific contents are as follows
Project structure
Default.aspxUpload.aspxscripts/...Style.css
Effect chart
Client HTML code
;!
Client
Server Side (Test.cs)
System.IO.Stream Stream = Request.inputstream
System.Xml.XmlDocument doc = new XmlDocument ();
Try
{
Doc. Load (stream); Load the XML document sent over
}
Catch
{
byte[] buffer = new Byte[stream. Length];
Stream.
Ajax requests another domain from one domain to have cross-domain problems. So how do you implement the Ajax Cross-domain request on the Nginx? To enable Cross-domain requests on nginx, you need to add add_header access-control* directives. As shown
Nginx + tomcat on the server, where Nginx listens on port 80 and Tomcat listens on 8080 ports.
Because the front end is unfamiliar, thought that uses the Ajax to be possible does not need callback, however the front end schoolmate said does not
Ajax Operation Global Monitoring, user session failure of the solution
jquery (function ($) {
//Back up jquery Ajax method
var _ajax = $.ajax;
Rewrite the Ajax method to first determine that the login is executing the success function
$.ajax =
Ajaxfileupload control is very useful, but found that the results of uploading files for browser processing, IE will not, Google and Firefox will be processed, and Google and Firefox after the results are not the same, here for the above three
The advantages of loading on demand: In the actual survey found that a lot of netizens in the site with a clear point of reference, often in the home page directly after the search into their own needs of the list of goods, if the customer entered
Ajax submits the server data and collates the conversion methods.
Html:
1. The form element turns querystring
2. Strings, JSON converting to each other
var obj = Jquery.parsejson (' {' name ': ' John '} ');
An environment to build
The first is a regular spring MVC environment, and needless to say, it needs to be noted that you need to introduce the Jackson-related jar package and then add the JSON resolution-related configuration in the Spring
Url:
Requires that the requested address be sent for a string type argument, which defaults to the current page address.
Type
Requires a string type parameter, the request method (post live get) defaults to get. Note that other HTTP request
Use Ajax to verify that the username code looks like this:
Interface:
get guestbook/index.php
m:index
a:verifyusername
Username: User name to authenticate
Return
{Code
: returned information 0 = no error, 1 = error message: Returned
We should be able to cite several commonly used asynchronous file upload function, the use of more frequent native Ajax and IFRAME framework, to achieve picture file upload, the following for everyone to share the picture file upload two ways:
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