Home > Back-end >  J2ee connect to the database, delete and modify the list of data, how to display dialog box, click c
J2ee connect to the database, delete and modify the list of data, how to display dialog box, click c

Time:10-01

Now I'm stuck in: click confirm or cancel, will be deleted or modify the data,

Javascript will not achieve this kind of question, also please predecessors answer, thank you,

CodePudding user response:

Js code is running on the browser, your JSP/servlet is running on the server code, you have to write through HTTP requests to trigger the service side good logic.

Js delete operation is to get a url, the server receives an HTTP request, and then according to the rules of the route to a servlet/controller.

Do you think is the question of js can run Java code directly, that is the wrong cognition.

CodePudding user response:

Because & lt; A> Tag href has died, a corresponding href, just click on the browser will request to delete data
Solution is not provide href value, direct onclick=dl (id), href jump in dl function, or an asynchronous request

CodePudding user response:

I try you, I don't know much about the first, the second a little understand, thank you
  • Related