Solved

open and maximize a new window when clicking a link

Posted on 2004-04-23
10
1,764 Views
Last Modified: 2009-07-29
I'm placing a web document as a desktop item in Windows XP.  It is supposed to be an automated background, if you will.  This way i can control things without clicking around XP.  I'm trying to create a link to a website, and when you click on it you get a traditional internet explorer window, maximized, with the intended location.  I tried the javascript:window.open('url') but i get a new window with the address bar saying just the code and not going to the intended location.  I also tried just using html and using target="_blank" and it works, but again the window isn't maximized.  How do i do this?  Thanks!
0
Comment
Question by:dartfrogs404
  • 5
  • 4
10 Comments
 
LVL 25

Expert Comment

by:devic
ID: 10904775
<a href=http://www.google.com onclick="window.open( this.href,'','width='+screen.width+',height='+screen.height);return false;">google</a>
0
 

Author Comment

by:dartfrogs404
ID: 10904908
I get a window in the bottom half of the screen, not maximized, no toolbars or anything.
0
 
LVL 25

Expert Comment

by:devic
ID: 10904941
for example this:

<script>
function openWin(theHREF)
{
      var myWin=window.open(theHREF,'','width='+screen.width+',height='+screen.height+ ',top=0,left=0,scrollbars=1,toolbar=1,staus=1');
}
</script>
<a href=http://www.google.com onclick="openWin(this.href);return false;">google</a>


http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/open_0.asp


0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:dartfrogs404
ID: 10904983
i added menubar=1 and addressbar=1 to fix those missing, that makes the window do the same thing as before.  Even without those, the window is in an odd position on the screen and the maximize button is disabled!
0
 
LVL 25

Expert Comment

by:devic
ID: 10905010
resizable=1
location=1

here is decription for all possible options:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/open_0.asp
0
 

Author Comment

by:dartfrogs404
ID: 10905028
i can do that, but still, there is no code to have the window automatically maximized.  Plus if i add the code for the menubars and the addressbars to what you suggested, it shrinks back down to 1/4 of the screen.  Question still unanswered :-/
0
 
LVL 25

Expert Comment

by:devic
ID: 10905083
do not forget to refresh your desktop ;)
============================
<script>
function openWin(theHREF)
{
      var myWin=window.open(theHREF,'','width='+screen.width+',height='+screen.height+ ',top=0,left=0,scrollbars=1,toolbar=1,staus=1,resizable=1,location=1');
}
</script>
<a href=http://www.google.com onclick="openWin(this.href);return false;">google</a>
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 10905146
You may need to do this (building on Devic's code)

window.moveTo(x, y)
function openWin(theHREF)
{
     var myWin=window.open(theHREF,'','width='+screen.width+',height='+screen.height+ ',top=0,left=0,scrollbars=1,toolbar=1,staus=1,resizable=1,location=1');
myWin.moveTo(0,0)
}
</script>
0
 
LVL 25

Accepted Solution

by:
devic earned 250 total points
ID: 10905299
also you can use VBS:

=============================VBS=====================================
<script language=vbscript>
Function openWinVBS(theHREF)
      Set ie = CreateObject("InternetExplorer.Application")
      ie.height = Screen.AvailHeight
      ie.width = Screen.AvailWidth
      ie.left = 0
      ie.top = 0
      ie.menubar = True
      ie.toolbar = True
      ie.statusbar = True
      ie.resizable = True
      ie.navigate theHREF
      ie.visible = True
End Function
</script>

<a href=http://www.google.com onclick="javascript:openWinVBS(this.href);return false;">google</a>


=============================JS=====================================


<script language=javascript>
function openWin(theHREF)
{
    var myWin=window.open(theHREF,'','width='+screen.availWidth+',height='+screen.availHeight+ ',top=0,left=0,scrollbars=1,toolbar=1,staus=1,resizable=1,location=1');
}
</script>
<a href=http://www.google.com onclick="javascript:openWin(this.href);return false;">google</a>

0
 

Author Comment

by:dartfrogs404
ID: 10908405
It's not exactly maximized, but it shows all the bars i want and fills the screen.  Thanks to all!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

840 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