Greg C
Greg C

Reputation: 1

How do I determine if a page is a MODAL

Is there any way in JavaScript I can see if the page I am loading is a modal?

I know I can see if it's in iframe by doing something like this:

var isInIFrame = window.location != window.parent.location ? true : false;

But I wanted to know if there was code to see if it was a modal window.

Upvotes: 0

Views: 1434

Answers (1)

Tor Valamo
Tor Valamo

Reputation: 33759

You can check for window.dialogArguments.

if (window.dialogArguments) {
  // modal window
}

Edit: That also applies to showModelessDialog, but if you don't use that function, then this works.

Upvotes: 2

Related Questions