Written in front, in the author of this demo, I found that now we do not use AJAX to complete the Cascade menu, in fact, the author of this demo is not to complete this, the author's main learning direction is javaweb backstage business logic development. But to do the backstage or need to have a knowledge of the front-end, especially like Ajax this asynchronous submission of data technology needs to understand and master. So here I use a cascading menu to practice Ajax asynchronous submission, of course, the follow-up will also write several asynchronous submission form demo.
The background of the author is used in the SPRING+SPRINGMVC frame, here does not explain this part, focus on jquery and Ajax.
First, download jquery.js this resource
jquery website Link
Second, import the downloaded jquery.js into the project
In the Javaweb project, just put it in the webcontent (or you can set up your own folder, but not in the Web-inf file)
Third, start writing code
Create a new JSP file
The code is as follows
<% @page import= "Java.util.Map"%> <% @page import= "java.util.List"%> <%@ page language= "Java" Contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%> <!
DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >
Finally, the results of the implementation of the picture
The above is a small set to introduce the Javaweb development of the use of jquery and Ajax to achieve dynamic Cascade menu effect, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!