Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Maximize pop up window from another site with JavaScript

Posted on 2004-08-05
5
Medium Priority
?
1,875 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

618 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