Jspscript functionRun on another page

Asked 2 years ago, Updated 2 years ago, 46 views

I want to make it deactivated when I press the button. But if you press the disable button on a.jsp, b.I want to make the target button in jsp disabled.

a.jsp <- This is the HTML button If you press this button, btnActive() is executed function btnActive(){Content Content} <- This is the script This is b.To disable the target button on the jsp b.jsp Target Button

It's not on the same page, so I don't know what to do.

jsp script function

2022-09-20 12:32

3 Answers

I'm posting it again because the writing got weird

I want to make it deactivated when I press the button. But if you press the disable button on a.jsp, b.I want to make the target button in jsp disabled.

a.jsp
<Button onclick="btnActive()"> <- This is the html button
Press this button to run btnActive() function btnActive(){content} <- This is the script
This is b.b so that the target button is disabled on the jsp.jsp target button

It's not on the same page, so I don't know what to do.


2022-09-20 12:32

I can't write it down. Anyway, a.jsp is not a button, but a button active () is inside the button ㅠ<


2022-09-20 12:32

Let me separate the issues.

Let me deal with the second one first.

2. What should I do if I do ?I think you should understand the key principle at this point, but moving on to b.jsp is nothing more than receiving an HTTP response by requesting b.jsp.
If so, when a.jsp executes btnActive(), you can request b.jsp but send a request, "Give me a response with these buttons disabled." Whether the request method is GET or POST, and whether to disable the button in b by disabled="true" from the beginning or whether the script dynamically disables it is a secondary problem.

1. But should I do this?This is a very literal reverse question. What you're trying to implement is really b.Should the navigation movement occur with jsp? I'm actually staying in a.jsp, but can't you just pretend that it's on a different page? Many things like step wizard do that, and today's web apps like react and actually work like that.
And think about it carefully. If someone just enters b.jsp in the address bar and enters b.jsp immediately without going through a.jsp, should I allow that? If I have to, is the button disabled? Why do you need such a ban if you shouldn't? There's no such simple and legitimate act of accessing something in the web world as "directly entering an address."

I've explained the basic concepts up to here. Let's understand first, then think about it carefully, and turn the question into a better one.


2022-09-20 12:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.