473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to write a JS to check if a page is loaded by a normal page or a modeless window?

I have a page which will be loaded by some normal windows and some modeless windows(which is opened by code "window.showModalDialog()"), and I want to show different message in this page to these two situations.

I have thought about to check the existence of parent window, but it fails as a normal page can also have a parent window while loaded after a click on a link or button.

Please help, any hints will be appreciated. Thanks in advanced.
Jul 8 '10 #1
1 1295
gits
5,390 Expert Mod 4TB
do you have controll over the opening of a 'normal' window or a modal one? ... or might that be used randomly in different apps?

when you couldn't control that, i doubt that you could do anything ... but you might try to find out a property of the window that might make it distinct - try to compare the properties of such windows by tracking them with:

Expand|Select|Wrap|Line Numbers
  1. for (var i in window) {
  2.     // output as you wish -> just an alert for demo
  3.     alert('prop: ' + i + ' = ' + window[i]);
  4. }
might be that such an modal window has a property that you might use for your requirement (like modal = true ... or similar)
Jul 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Michael | last post by:
Hi, I create site with a prefix FramSet layout. The main page contains HTML <Form> function like this <Form name=my_form method=post action=my_action.asp> <input name=search_string ...
2
by: Christian Schmitt | last post by:
I load a page into an iframe that comes from another server. If this page is not accessible, this server redirects to a login page. I want to check if the correct page was loaded in the iframe in...
6
by: foldface | last post by:
Hi I think from looking into google newsgroups history that you can't do this, however can someone confirm that: Using IE6 Can you load a web page (say www.google.co.uk) Then move to a web...
7
by: Matt | last post by:
The html page is very long and has a button on the bottom. How to make the browser go to the bottom of the page when the page is loaded?? Thanks!
2
by: gsb | last post by:
Dynamically, I create a container DIV with an iFrame inside. When the iFrame content page is loaded, I would like to determine the ID, name DIV object reference of the "container" DIV with an...
3
by: AdamMorris | last post by:
I have a very interesting problem and can't seem to figure it out. Basically I'm trying to make a Training Assistant: a window that will guide the user through the setup process of an online app....
1
by: Zuhaib Hyder | last post by:
how to logout from frame window/page to normal window/page (no frame)? and how to open new normal page(no frame) from frame page?
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
2
by: ganesh22 | last post by:
Hi, How to write code in page load to display that window size like popup? ex: Here i writen the code in OnClientClick event now i want in page load javascript:window.open('Default4.aspx?a='...
7
by: sumanta123 | last post by:
Dear All, How will we do in JSP page on closing the parent window the child windows should close automatically. I will show my code Please i will show you my code. For HTML link function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.