The project is SSH, using jquery's $.post to access Struts2 's action, where there is no error, but no results.
Now $.post is going to return the collection Collection that holds the permission, and the permission class privilege is associated
A strange problem, in the use of Ajax submitted when the return value assigned to a variable, no matter how to write a value, just start to suspect JS error but IE did not respond, many times clear the cache, the Ministry of Procedures have no
Using JavaScript to manipulate DOM elements to refresh pages and reorganize data, rely on CSS to provide a consistent interface for applications, use XMLHttpRequest objects to communicate asynchronously with servers, submit requests in the
Today you need to do remote data loading and rendering pages in your project until the development phase is aware of the problem of Ajax Cross-domain requests. So I want to solve this cross-domain problem with the way of proxy.
What is a cross
This example is to achieve the provincial and municipal two-level linkage, when the choice of a province, the city below the province will be shown in another Drop-down box. In this example, Ajax is passed back to the JSP page by parsing the data
Ajax principles:
The client sends an asynchronous request through the browser's built-in object XMLHttpRequest, and when the server returns a response, the previously registered callback function is invoked, and the JavaScript action dom can be
Apart, directly to the code, believe that the need is the code rather than a pile of nonsense ...
1.java Code:
Copy Code code as follows:
Package TT;
Import java.io.IOException;
Import Java.io.PrintWriter;
Import
Copy Code code as follows:
Quick query: by inner tube code by tag Code
Here is the referenced JS file
Copy Code code as follows:
$ (document). Ready (function () {
$ ("#fastsearchTxt"). KeyUp (function () {
Index.html
Copy Code code as follows:
jquery Ajax Example Demo
Enter Name:
input Password:
ajax submit
post submit
get submit
login.php
Copy Code code as follows:
echo json_encode
The so-called long connection, is to continue to send requests, blocking requests on the server side, each time over the request to resend the request, keep the connection, at any time to get the server-side response data
Project case:
Copy code code as follows:
/**
* Ajax Way Delete Information--Background data
*
* ACTION
* ID PRIMARY key value
* obj Delete line
/
Function Removerow (action,id,obj) {
If confirm (' OK to delete? ') {
Brief Introduction
Before we know how to use Ajax to return JSON data, we need to understand the following points
1, how JSON to represent the object's
2, how JSON to represent the array of
Copy Code code as follows:
var object =
Copy Code code as follows:
————————————————————— This is Ajax (JavaScript) code ——————————————————————————— function Send_request (Callback, urladdress, Isreturndata) {
var xmlhttp = getxmlhttprequest ();
Xmlhttp.onreadystatechange =
The
key method:sort () to sort the elements of the array.
return a.num-b.num is ascending;
return b.num-a.num; is descending
Writeln in the output after \ n, in the document is a newline, in the HTML is interpreted as a space.
Copy Code code
Using jquery's AJAX functionality to invoke a page, you find that there is always an error.
JS code is as follows
Copy Code code as follows:
$.ajax ({
Type: ' Post ',
URL: ' testdata.aspx ',
Data: {
Language_type: ' CN '},
As one of the evaluation system to join a new function "questionnaire", I would like to use other people do a good survey questionnaire, with others have a good thing is: People do professional, interface beautification and so very user-friendly,
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.