Halo, I put a simple js in JavaScript menu and I would like to call it when a button is clicked. What type of js line shall I write on click even?
Halo, I put a simple js in JavaScript menu and I would like to call it when a button is clicked. What type of js line shall I write on click even?
Hello Solomon,
On click event you may choose action Run JS and put your code there.
Sorry Evgene K. for confusing you. based on the step "Create New -Java Script", I already put a java script named "refresh.js" in my project JavaScript directory . rather than copy and pest every were I would like to call it on click even. So what kind of method or on click Run JS action to call "refresh.js" .
thanks
Hi Solomon,
JS asset - injects as JS file.
It runs at application load.
If you have some functionality in this JS asset you should wrap it with some function. Example:
pre
function RunMyFuncFromMyAsset(){
alert("RunMyFuncFromMyAsset run");
//Here is your implementation.
};
/pre
Then you need to add "Run javascript" action on button "click" event and use following JS code:
pre
//Run function from your JS asset.
RunMyFuncFromMyAsset();
/pre
That's how JS works.
Regards.
you solved it, thanks, a lot.