Solved

open and maximize a new window when clicking a link

Posted on 2004-04-23
10
1,760 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

743 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

15 Experts available now in Live!

Get 1:1 Help Now