开发者

How do I determine if a page is a MODAL

开发者 https://www.devze.com 2022-12-16 08:02 出处:网络
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:

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开发者_StackOverflow was a modal window.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消