Why onload event in javascript is not working in UI Macro

sree42
Tera Contributor

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');

}

2 REPLIES 2

Samaksh Wani
Giga Sage
Giga Sage

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

Samaksh Wani
Giga Sage
Giga Sage

Hello @sree42 

 

Can you Plz Mark my Solution as Accept, if you got any help from it. it will help future readers.

 

Regards,

Samaksh