Solved

Check a PopUp Windows Properties

Posted on 2006-07-09
5
156 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now