| |

VerySource

 Forgot password?
 Register
Search
View: 2163|Reply: 14

Regarding calling the onload attribute in the struts tag, thank you

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Singapore

Post time: 2020-1-31 20:40:01
| Show all posts |Read mode
I would like to use attributes similar to <body onload = a ()> in the basic JSP pages of the struts framework. How do I configure and use them? Thank you.

The current form of the JSP page is as follows:

<html: form action = "test">
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-3 13:00:02
| Show all posts
<body onload = "a ();">
Is there a problem?
Reply

Use magic Report

0

Threads

11

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-5-10 07:00:01
| Show all posts
The onload = a () refers to the js function that executes the a () when the page is loaded, what do you want to do!
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-27 16:30:01
| Show all posts
Normal use
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-13 22:45:01
| Show all posts
Implement functions with js
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-4 13:30:01
| Show all posts
onload=a();a() is the initialization function before loading the page that you write in JAVASCRIPT etc. in the JSP page.
You can add <script language="JavaScript"> a(){........}</script> to the JSP file.
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-4 17:00:02
| Show all posts
This is a problem of JSP and JS, haha. Whether struts is not affected. Nothing needs to be configured.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-4 19:30:01
| Show all posts
Write javascript on the page
<body>
*********
</body>
Add after
<script type="text/javascript">
javascript method
</script>
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 United States

Post time: 2020-8-5 17:00:01
| Show all posts
..........
The use of javaScript has nothing to do with the Struts framework.
eg:
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function c()
{
//content
}
</SCRIPT>
</HEAD>
<body onload=a()>
</body>
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-5 17:15:01
| Show all posts
PS: typos, change the name of the method called by onload, c()
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list