Overview
Ajax Cross-domain is a common problem in front-end development, this article describes the solution with Google Chrome as the client and Tomcat as a Web server.
Problem phenomenon
When Cross-domain access occurs, Ajax usually reports
Ajax implementations in jquery are categorized in many ways, such as: Load, Jquery.get, Jquery.post, Jquery.getscript, jquery Ajax events, Jquery.ajaxsetup and so on, the previous several for the most commonly used jquery Ajax methods.
Web site
will be flexible use of Ajax methods, very important, this article first to introduce some of the Ajax methods, and then through an example for you to analyze the details, the specific content please see below
1.url:
Requires that the requested
Remote management technology of database
An important link in the modern application of Internet based WAN is the remote monitoring of database. First of all, a brief review of the Internet Database Remote management technology development process
jquery Ajax, when Async is false, the sync operation fails. Solutions, Jqueryasync
Recently do project encounter jquery Ajax, when Async is false, sync operation failure problem, the Internet search, get a solution, here on how to solve:
Code when
1,content-type
Many times the inability to parse is the content-type problem.
If you are an XML file, skip this step
Dynamically generated XML must be set to Text/xml, otherwise the default is text/html is ordinary text.
Content-type Settings for
Before we get to know Ajax, let's take a look at how browsers and servers interact.
1. The browser sends a request to the server
2. The server receives the request information, according to the different situation returns to the browser
This example describes jquery's method of customizing without refreshing submit form form based on Ajax methods. Share to everyone for your reference. The implementation methods are as follows:
The $.ajax method of jquery can implement Ajax calls,
If improper handling will affect the user experience, it may also produce inexplicable problems.
Combined with their own thinking and online related content reference, give the following solutions. Each scenario has different pros and cons,
Well, as the saying goes, easier said than done, put on the programming is easy to make up the difficulty, although there is no new technology Ajax, but the transformation of ideas and the integration of old technology, but to move hands or problems,
The data to be transmitted asynchronously:
XML code
....
....
Ajax Asynchronous Transfer code:
JS Code
Copy Code code as follows:
var postdata = "input=" + Escape (Inputjson) + "&script=" +escape (XML) +
"&feedgeneral=" + Escape
Here's my program.
Html:
Copy Code code as follows:
Untitled Page
Please enter your name:
REQUEST.ASHX:
Code
Copy Code code as follows:
Using System;
Using System.Web;
public
This article will show you how to use the jquery load method for local refresh, the load method itself is very simple, but want to integrate into the jfinal and bootstrap public projects, we need to work harder.
First, I'll start with the plan.
Objective:
This example probably features the front desk to invoke the generic handler (Handler) through jquery Ajax, get the information that the form needs to display, and then convert it back to the foreground in JSON format, and the front desk
Picture file Upload, there are many kinds of agreement, this time the main talk is "content-type:multipart/form-data;" The form.
At work at the front desk some static files are through the FTL template system, the front page is referenced through
Using the H5+asp.net General Handler development project, use Ajax to communicate back and forth. One scenario requires a different response from the front end based on the different data types returned by the server, and here's how to use $.ajax to
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