The project uses the AJAX technology query, the query result many times must the page display. These two days groped for a moment, here to do a summary, convenient for you to view at any time,Also convenient for posterity reference.Here's the order
(1) Simple interaction: Please select the interrogation room Interrogation room name ${room.name} ------------------------------the parameters submitted by the AJAX-----can be submitted through a URL, or
When jquery is used to operate Ajax today, the following error occurs when loading HTML blocks using the load method:XMLHttpRequest cannot load file ~~~~~~~ Origin 'null' is therefore not allowed accessThe reason is as follows:Hosts
When Ajax technology is used, we usually use the same URL to retrieve data after refreshing the page to submit data, and we will find that the data is from the past ~ This creates an illusion for the client ~~ You can cancel the cache using the
1. In general, context. response. contenttype = "text/plain" in the processing program, the Ajax parameter is also of the text type.
2. The general handler converts the data to the JSON data format:
Namespace: Using newtonsoft. JSON;
Code:
The first sentence is written in this way: programmers are hard-pressed and will write blog posts in addition to development! Ah, today I will discuss with you the use of the Ajax auxiliary method actionlink. If there are some bad or wrong places,
I. What is Ajax?
Ajax (Asynchronous JavaScript and XML) Asynchronous JavaScript and XML, through interaction with the back-end interface, achieve partial page refresh.
Ii. Ajax principles
Ajax interacts with the server through XMLHttpRequest (all
Ajax garbled solution Summary
First, JavaScript follows the Java character processing method, and Unicode is used internally to process all characters,
Second, UTF-8 is stored in three bytes for each Chinese character (UNICODE character.
Third,
After opening the debugging tool, the reason is clear: the Ajax returned result http304... each request is cached, and chrome and other browsers normally return 200.
[Solution]
Ajax requests under IE are cached Based on IP addresses and
For example: Normal B/S mode (synchronous) Ajax technology (asynchronous)Synchronization: submit a request, wait for the server to process, and return the result. The client browser cannot do anything during this period.Asynchronous: requests are
Web Front-end JS Code:
$. Ajaxsetup ({contenttype: "application/X-WWW-form-urlencoded; charset = UTF-8", complete: function (xhr, textstatus) {If (xhr. status = 520) {// If the returned status code is 520 window. location .. reload (); // refresh
Problem:
When I write a webpage's "User Login" section, I want to upload the user name and password to the backend for verification. I want to use the Ajax asynchronous submission function on the front end
The user name and password are uploaded to
Right-click the menu today. When you click Rename to make an Ajax request, the page will jump directly to the homepage instead of sending data to the background. Bai Si cannot solve the problem. Later, he found a problem on the front-end page:Copy
When I first started writing AJAX code, I directly referred to the Code in the basic AJAX tutorial book (this book is really good, it is a classic tutorial for getting started with AJAX, and it is from the Turing Publishing House. I trust O 'r and
Art. dialog and ajax asynchronous requests, ajax asynchronous requests
I wrote some code last week, involving jquery asynchronous requests. I would like to summarize it here to help students who are new to programming.
It is used to the art.
The interface is the detailed list of AJAX parameters in Jquery:
Parameter Name
Type
Description
Url
String
(Default: Current page address) the address of the request sent.
Type
String
(Default: "GET")
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