function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AUEagleAUEagle 

Execute Javascript - OnClick JavaScript

I have written a javascript that I inserted into the "Execute Javascript - OnClick JavaScript" that is attached to a "Create New Event" button on my contacts Page.  When I scroll down to the Activities section on my contact page and click on the "Create New Event" button, an new event page opens up in the existing window without any problem.  However, if I hover over the "Open Activites" link at the top of the page,  the small popup window with the Open Activities buttons appear.  When I click on the "Create New Event" from within this popup box, my new event page attempts to open within the popup box.  How can I test to check if I am in the popup window in my javascript code.  I presume I will have to close the popup window before attemptiing to open the event window, but I don't know how to test whether I am in the popup window or not.  Here is the code I currently have to open the window.

 

//open the event window in the current window

window.location="/"+"00U/e";

 

//what I think I want to do is something like this

if (i am currently in a popup window)

    close the popup window;

    open the event window.location

 

 

joshbirkjoshbirk

To determine if a window is a popup, try checking to see if "window.opener" equals null.