?
Solved

Maximize pop up window from another site with JavaScript

Posted on 2004-08-05
5
Medium Priority
?
1,873 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 152 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 148 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

764 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