Solved

open and maximize a new window when clicking a link

Posted on 2004-04-23
10
1,761 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
 

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
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.

 

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

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
jQuery detect if it is a mobile device 3 90
Basic JavaScript Question 3 37
Randomize in Owl Carousel v1.3.2 6 16
Change javascript css 1 16
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…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

937 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

1 Experts available now in Live!

Get 1:1 Help Now