Have a custom button and trying to open external link on button click. It works fine. But I would like to check if the window is already open and if yes, donot open another window:
right now i have (on button click) > Execute Javascript :
window.open('http://www.google.com');
I tried to add function to check if window is already open as below:
var isOpen = "false";
alert('hi');
function OpenPopup()
{
alert('hi');
if(isOpen == "false")
{
isOpen = "true";
window.open('http://www.google.com');
}
}
But seems like I cannot use function inside as the onclick is not working after changing the code. First alert works but the one inside function is not working.