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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link from a pop up into a new window

Status
Not open for further replies.

neroe

Technical User
Feb 27, 2003
54
0
0
GB
the scenario;
i have a regular .html, on it is a link to a popup. once the link is clicked the user is to answer the questions presented in the popup.the popup has no statusbar, toolbar or scrollbar as i have set these to "no" in the function that fires the popup from the first page. once the questions are answered i then want (from the popup) for the user to click a link and end up in a fully featured browser window i.e. scrollbar, toolbar etc.

problem i am having;
the link into the desired fully featured browser doesnt happen exactly how i want it to. i use the following function on the page that i want fully featured;

function expandindow()
{
self.resizeTo(screen.availWidth,screen.availHeight);
window.moveTo(0,0);
window.defaultStatus='';
}
expandindow();

this forces the popup to the width/height of the users monitor and loads the correct page, but i want to know how to alter the function to allow the toolbar, stausbar etc to appear.
i have a feeling that i need to open a new window with the page init but the problem with that is that i need to kill the popup as it is left behind.

unfortunatly for me, my javascript is not up to that so i was hoping to find a guru right here!

any help advice, much appreciated. thankyou!
 
i have a feeling that i need to open a new window

You feel correct [smile]

Try some code like this to close the original popup after the new one is opened.

Code:
window.open('whatever');
self.focus();
self.close();

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
[banghead]
 
i knew i'd find a guru . . . thanks very much, worked like a charm first time
 
You're very welcome [thumbsup2]

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
[banghead]
 
this solution has developed a problem. the code worked perfectly in some test pages that I built. once I dropped the code into the pages that I needed it for a problem occured in that the popup dies but it does not open the next fully featured window. however if I put an alert in like this;

window.open('whatever');
self.focus();
self.close();
alert();

. . . the fully featured window opens. its as though the alert holds the script up to allow time for the next fully featured window to open. obviously I can't have the alert there as a permanent feature.

any ideas how I can get around this ?
 
no worries . . . fixed it now.

setTimeout("self.close()",1250);

thank god for google!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top