tags:

views:

37

answers:

1

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

I know I can see if its 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..

+1  A: 

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.

Tor Valamo