Ajax, the "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), is a web development technology that creates interactive Web applications that enables asynchronous updating of web pages through a small amount of data exchange in the background with the server.
Through the code example analysis to introduce AJAX implementation page local jump and results returned, the specific contents are as follows:
After clicking on the quote button, you can use Ajax to implement the jump to action, JavaScript code:
After the action process is completed, the returned results are placed in result, and the page pops up with the message; Of course, the action jump here needs to configure XML.
The background Java class processing process is:
Here is a SQL statement to the data processing, return a message, and print the information to the page;
The result of the operation here is reflected to the response corresponding position, so get the stream belonging to the response, not the new one out.
That means I jump from there, and this information will go back there. So in JS you can use result to receive this return results, and with alert hint.
How to implement page jumps with Ajax
The sample code is as follows:
The project uses the Ajaxanywhere framework to achieve AJAX, the effect is good, and easy to implement, but now the problem is that even if the page has achieved results, the business still needs to submit the form, in which case, even if the click Submitted, it will still refresh your well-defined zone area, this time, If the simple submission of the form is not enough, I take the program is:
Use JS, a powerful BS project development tool, to customize a function to solve the above problem:
The above content is this article introduces how Ajax realizes the page partial jump and the result returns the entire content, hoped everybody likes.