...

View Full Version : Open one page (in a brand new window) when another page loads



dmk
12-12-2002, 09:55 PM
When my users select one page (by hyperlink), I want them to be automatically taken to another page and that page must open in its own window -- not in one of the frames.

This is what I found:

<meta http-equiv="Refresh" content="1; URL=homedir/file.mrc">

It works except I don't know how to set the target to a new window that opens.

Thanks.

ACJavascript
12-13-2002, 12:18 AM
wouldn it be easeir just to set a link to it?

like <a href="homedir/file.mrc" target="_new">Click here</a>



Hope this helps,,,

I dont think you are able to set the target for a refresh like that

dmk
12-13-2002, 05:33 AM
This is what I'm doing: The user clicks a menu item hyperlink. A page opens that just says Please wait. In the header of that page I have this line of code:

<meta http-equiv="Refresh" content="1; URL=homedir/file.mrc">

That code causes the actual form (the object of the hyperlink) to automatically open. I had to go that way because it's the only way I could think of to get that form to open in a new window. The above code works beautifully except that the page opens in a frame and I must have it open in its own new window. Is there a "target" parameter I can use in that line of code?

I can use a regular hyperlink if I have to, but I don't want the users to have to click a hyperlink on two different pages to finally get to the desired page. You see it all the time on the Internet -- how do they do that? :confused:

Thanks.

ACJavascript
12-13-2002, 09:18 PM
what is the navigational script you are using can you post it?
You might just be able to set the target on the script.

Like i said,,, i dont think you can set the target like that on a refresh.. if im wrong someone please tell me.

dmk
12-14-2002, 05:29 AM
Thanks for looking at this. I'm open to any suggestions. One thing I can't change, however, is the way my drop-down menus work. This is the code in the head of the frame that holds the drop-down menus:
======================================
<head>
<script LANGUAGE="JavaScript">
<!--
function JumpToIt (list)
{
var selection = list.options[list.selectedIndex].value
if (selection != "None") {
parent.body.location.href = selection
}
list.selectedIndex=0
}


//-->
=======================================
This is the code of the actual drop-down menu (there are several in the frame):

<form>
<select WIDTH="1" onChange="JumpToIt(this)" size="1" name="Finance" style="font-family: Arial; font-size: 8pt; position: relative; float: left; width: 150">


<option VALUE="http://dk_intranet/link_pg_finance_dept.htm" selected>Finance Department
--->
<option VALUE="http://dk_intranet/FinanceDept/BillCover.pdf">Bill Cover Ltr Instructions</option>
<option VALUE="http://dk_intranet/FinanceDept/Work Assignmt.htm">Billing/Attorney Assignments</option>
<option value="http://dk_intranet/NoCheck.htm">Check Request</option>
<option VALUE="http://dk_intranet/FinanceDept/ExpenseRpt.xls">Expense Report</option>

</select></form>

</script>

That script opens the linked files in another frame and that's always been fine. But I have an Excel spreadsheet (ExpenseRpt.xls) I'm linking to and if it opens in a frame, there are printing issues. If it opens in a new window, however, it prints fine.

So I ran my link from the drop-down to a dummy sheet, wherein I have the refresh code that opens the actual spreadsheet. It opens in a frame, however, and, well, that was the problem to begin with. I don't want to change the code of my drop-down menu frame because everything else on it works great -- this one menu item is the exception.

Any suggestions? Do you need to see anything else? Thanks.

d

ACJavascript
12-14-2002, 04:24 PM
Okay this is what i did,
I changed the
if(selection !="None")
to
if(selection !="NewWindow)

then i put in a else structure.. In the option value for the Expense Report it put this <option value="NewWindow">

So heres how it looks all together..

________________________

<head>
<script LANGUAGE="JavaScript">
<!--
function JumpToIt (list)
{
var selection = list.options[list.selectedIndex].value
if (selection != "NewWindow") {
parent.body.location.href = selection
}else{
window.open("http://dk_intranet/FinanceDept/ExpenseRpt.xls","def")
}
list.selectedIndex=0
}


//-->

</script>


<form>
<select WIDTH="1" onChange="JumpToIt(this)" size="1" name="Finance" style="font-family: Arial; font-size: 8pt; position: relative; float: left; width: 150">


<option VALUE="http://dk_intranet/link_pg_finance_dept.htm" selected>Finance Department
--->
<option VALUE="http://dk_intranet/FinanceDept/BillCover.pdf">Bill Cover Ltr Instructions</option>
<option VALUE="http://dk_intranet/FinanceDept/Work Assignmt.htm">Billing/Attorney Assignments</option>
<option value="http://dk_intranet/NoCheck.htm">Check Request</option>
<option VALUE="NewWindow">Expense Report</option>

</select></form>


-_____________________

Hope this works for ya :D

dmk
12-16-2002, 04:25 AM
:) :) :) :thumbsup:
It's wonderful! Thank you SO much! Everything is perfect.

d

ACJavascript
12-16-2002, 05:03 PM
Your most welcome :thumbsup:

Happy Scripting :D :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum