Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open predefined window

Status
Not open for further replies.

videll

Programmer
Jan 25, 2002
2
US
I want to open a window from our web site using a predetermined size and chrome settings based on the option the user has selected from a table option with an attached url. For now, the user clicks on the row and it calls an asp which determines the page type based on a parameter passed with the url (i.e., href=start.asp?pg=fullframe.asp). The start.asp uses window.open with the url and sets the features as required by the call. Problem is, start.asp seems to be opening its own window and then opening another window with the window.open call. Left as it is, there is another window left hanging around everytime you call start. And if I use a window.close within the script, some users (not all) get an alert message ("this page is trying to close your window. Ok?") This is very aggravating and confusing for the users. Can someone tell me how to improve this code to get the window I want and not get the errors?

TIA
 
Hi,
You have 2 choices:
1. Embed the settings of the new window in the First window. Instead of using the A HREF tag, use a SPAN with the onclick() event to set the size of the new window.

2. Using your current codes, on the window 2 (the one your A HREF calls), use your ASP to generate client size script on the onload() event to set the size of the window. Note, this removes the need of a window.open function here as it reformats the existing window in the window.onload() event.

regards,
- Joseph
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Please visit Replica Watches, Jerseys, Pen, Hats, Handbags and More
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
 
Joseph,
Option two would be great but I can't find the references anywhere that specify the syntax for sizing the window within the script. In the window.open event, I'm setting a FEATURES string with tags such as "width=200;toolbars=No" etc. Would the proper syntax in the window onload event be

window.toolbars = No
window.width = 200
and so on???

Thanks for your reply; hope you can answer the above as well!

 
Hi,
Not all "features" are available for real-time changes (for example, the toggling of scroll-bar and/or toolbars. Those you have to set up front. However, you can resize the window.

window.resizeBy( ix, iy )
window.resizeTo( ix, iy )

The full settings can be found in the MSDN under 'window object'. Hope this helps.

regards,
- Joseph ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Visit --> for (Replica) Watches, Pen, Handbags, Hats, Jerseys and more ... at prices that makes your code spin ...
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top