Why onload event in javascript is not working in UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 05:05 AM
Hi All,
I have one requirement to add field on attachment UI Macro. I have added also. But I need to get some data from table when onload the page. It is not working as expected.
The below is the piece of code.
For testing purpose I have added the alert message inside the function that called as onLoad event in UI Macro.
Please anyone help me on this? Thanks in advance.
<a class ="abc" id= '' onLoad='doLoad(this);' " role="button">${gs.getMessage('[abc]')} </a>
<script>
function doLoad(pub) {
alert('test');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 05:08 AM
Hello @sree42
Add this to your existing script below xyz function defintion
addLoadEvent( function() {
xyz();
});
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 05:37 AM
Hello @sree42
Can you Plz Mark my Solution as Accept, if you got any help from it. it will help future readers.
Regards,
Samaksh