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

open window without statusbar, menubar.....with ASP parameter 1

Status
Not open for further replies.

JeroenDortmans

Technical User
Aug 7, 2001
56
NL
Hi,

I have a database result page where I have a number which I send to another page in a new window by a hyperlink. The number is send by asp code like this: <a href=&quot;Write_BAT.asp?Drawing_number=<%=FP_FieldURL(fp_rs,&quot;Drawing_number&quot;)%>
Now I want to open this new window as fast as possible and when the script which runs in this new window is &quot;ready&quot; the new window must be closed. For opening this window fast, I don't want to include a menubar, statusbar, toolbar and so on. How can I open the new window like this and send the parameter to the new page? What is the JavaScript code to close a window?
 
function popIt(parameter){
var url = 'Write_BAT.asp?Drawing_number='+parameter;
var x = window.open(url,'popWin','status=no,toolbars=no,width=400,height=400');
x.moveTo(50,50);
}

Feel free to modify those parameters as needed.

To close the window, if you're closing it from the same main page, then just issue:

x.close();

If you're closing it from the popup window, itself, then the command is:

window.close();

:)
paul
penny.gif
penny.gif
 
On my database result page I have an as a result a number. Making a hyperlink of this number I want to send this number to another page, I will name it &quot;create_file_page&quot;, where this number is used for a create file script made with ASP. This &quot;create_file_page&quot; is only script language, no viewable HTML. Therefore, I only want to run this script and after that close the page. That is why I want a window with no menubar, statusbar en so on, and close it after the script is ready.
With the script you suggested I can't click on the hyperlink in the database result page. I think in my first posting I wasn't clear. I hope you now understand my problem.
 
Sure you can. just make the link look like this:

<a href=&quot;javascript:popIt(theParameterGoesHere);&quot;>Click here to pop the window</a>

The last line on your popup window script should look like this:

response.write(&quot;<script language=javascript>window.close();</script>&quot;)

hope that clears it up. :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top