I want to mention that my javascript function is in the header of my website. After clicking the button I want to execute my javascript code and also go to external URL.
The onclick event would be the same on all buttons, only the links would be different
Or tell please where in the files of the plugin to add onclick=”myFunction();” to appear after the url introduced on every button
-
This reply was modified 9 years ago by
andreipol.
-
This reply was modified 9 years ago by
andreipol.
Hi,
You can’t do both at the same time, the browser has to decide then if it should go to the URL or run the javascript function and both will work unreliably.
What you can do however is hook the javascript function to the button and then let the JS function do the redirect to URL.
In the URL field of the button you can enter the javascript function :
javascript:myFunction();
or even pass the URL there
javascript:myFunction('http://');
and then have a JS function:
function myFunction(url) {
[ stuff to do here ]
window.location = url;
}
@andreipol is this issue resolved?