When the above html is loaded, due to If the onload attribute is set in the body tag, its corresponding javascript function will run. Finally, we go to the function makemoduleSelect(). Let’s take a look at this function:
url attribute, which is similar to the AJAX jump url. Here I use jsp page (indexStatisticsAction_getSelect.jsp) under the same path, which will be shown below; data attribute, which will be used as a parameter of the request and obtained by request; success attribute, which indicates that the jquery ajax request returns successfully The code that will be executed, where $("#makemodule") refers to the drop-down box.
The following is the jsp corresponding to the url requested by ajax. The JDBC related packages are deleted here and imported by yourself. I won’t go into details about JDBC. Code the business logic as needed.
The above sql statement will take out two values, which are the display value and the true value of the select drop-down box, and set an
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn