Solved

Check a PopUp Windows Properties

Posted on 2006-07-09
5
158 Views
Last Modified: 2011-10-03
How do i check a PopUp Windows Properties once it loads?

I need to check the width, height, top position , left position, scrollbars and resizable values that are passed from the window.open function that launches this window.

How do I do this?

Checking if scroll is enabled and resize is disabled is most important.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT type=text/javascript>
function WinParams()
{
  if( //Verify widht, height and other things here)
  {
    alert("Valid Window");
  } else
{
    alert("Invalid Window");
}
}
</script>

</HEAD>

<body onload="self.focus();WinParams();">

</BODY>
</HTML>
0
Comment
Question by:dpinto04
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 17071368
Can you tell us why you need to know?

It is not trivial to find these values unless you pass them in the url or have them as settings in the parent:

parent:

popResize = true
popScroll = false
function openWin() {
  window.open('test.html','newwin','scrollbars='+popScript+',resizable='+popResize)
}


child:

if (parent.popResize).....
0
 

Author Comment

by:dpinto04
ID: 17071485
Actually, i'll have a Window.open code that'll be installed on other sites, but which will draw data from our servers.
It'll be easy for users to change the size of the window and also enable or disable the scrollbars and tool bars and make things look odd.
Thats why i intend checking if the window is of a particular size and has scroll bars and is not resizable.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 20 total points
ID: 17071549
Sound to me you are better off designing your page so it can be resized and scrolled and NOT look odd when that happens...

Michel
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maps stopped work unsure why 7 35
execute script based on HTML event 7 24
add a 3rd selection to sum 7 29
Need Help adding an array and loop to a React file 7 28
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question