Solved

Maximize pop up window from another site with JavaScript

Posted on 2004-08-05
5
1,866 Views
Last Modified: 2012-05-05
I have a link in my site and I want that, when it is clicked, opens a new pop up window maximized (with for example http://www.anothersite.com/, not with a page that is hosted in my web). Because it is hosted in another site, I cannot use something like this (I cannot edit that page because it's in other site):

<script language="JavaScript1.2">
<!--
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>

I would like that the page "maximizes" to highest resolution available , no matter if the user has 800x600 or 1024x768 or another....
I don't know if it's possible to maximize, or only simulates this, resizing the window to these measures.
Thank you very much for your help. ;)
0
Comment
Question by:DeLaVegaz
5 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 38 total points
ID: 11730073
Hi

Use window.open:

var width=500;
var height=300;
if (screen) {
   width = screen.width;
   height = screen.height;
}
window.open(URL,NAME,'width='+width+',height='+height);


If you want it totally full screen, though, in IE, you can do this:

window.open(URL,NAME,'fullscreen=yes');

Regards,
Zyloch
0
 
LVL 33

Assisted Solution

by:knightEknight
knightEknight earned 37 total points
ID: 11730086
create a local page (on your website) that opens the window and sizes it, then redirect it to the other site:

<HTML>
<HEAD>
<script language="JavaScript1.2">
<!--
top.window.moveTo(0,0);
if (document.all) {
  top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
     top.window.outerHeight = screen.availHeight;
     top.window.outerWidth = screen.availWidth;
  }
}

location = "http://www.otherdomain.com/othersite.html";

//-->
</script>
</HEAD>
</HTML>
0
 
LVL 18

Expert Comment

by:arantius
ID: 11732163
Don't do it.  Users do not enjoy it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show confirmation alert in Jquery 14 47
Add Context Menu Item 4 45
jquery easyautocomplete for mutiple text boxes 9 55
Check if Object property exists? 3 19
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

864 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

19 Experts available now in Live!

Get 1:1 Help Now