Open a hyperlink in a new window - Publisher 2003

A

AaronMor

I have read all of these message boards and I can not get this to work. I
have multiple webpages that have multiples spots where if the user needs more
information they can click either a image or text that will take them to a
page with help information. Right now my pages all open in the same window. I
would like to have them open in seperate new windows.

I have tried the following which I thought would be the best solution since I
have multiple links on each page.

<script language="JavaScript" type="text/javascript">
function Show(Url, Name, Features) { window.open(Url, Name, Features); }
</script>

and then I used the following in the hyperlink of a image.

javascript:Show('index_files/5x_retrofit.htm','newwindow','toolbar=no,
scrollbars=yes,resizable=yes,height=250,width=250')

Everytime I get an error on the page, what am I doing wrong???????
 
A

AaronMor via OfficeKB.com

Hi Dave,
My website resides on a LAN server and therefore I have to use virtual
paths instead of http, does this make a difference. I entered in the absolute
link like you stated but still received an error on page message. Please
advise on the best possible solution.

Aaron
Try using an absolute link in the code:

javascript:Show('http://www.yoursite.com/index_files/5x_retrofit.htm','newwindow','toolbar=no,
scrollbars=yes,resizable=yes,height=250,width=250')

This is assuming that you actually have a page "5x_retrofit.htm" on your
site.

DavidF
I have read all of these message boards and I can not get this to work. I
have multiple webpages that have multiples spots where if the user needs
[quoted text clipped - 18 lines]
Everytime I get an error on the page, what am I doing wrong???????
 
D

DavidF

Sorry, but I don't know the answer. Keep playing with the path until you
find the correct way to write it, I guess...

DavidF

AaronMor via OfficeKB.com said:
Hi Dave,
My website resides on a LAN server and therefore I have to use virtual
paths instead of http, does this make a difference. I entered in the
absolute
link like you stated but still received an error on page message. Please
advise on the best possible solution.

Aaron
Try using an absolute link in the code:

javascript:Show('http://www.yoursite.com/index_files/5x_retrofit.htm','newwindow','toolbar=no,
scrollbars=yes,resizable=yes,height=250,width=250')

This is assuming that you actually have a page "5x_retrofit.htm" on your
site.

DavidF
I have read all of these message boards and I can not get this to work. I
have multiple webpages that have multiples spots where if the user needs
[quoted text clipped - 18 lines]
Everytime I get an error on the page, what am I doing wrong???????
 
S

Spike

I found that simple is GOOD.

I am using Publisher 2007 (have not tried this in Publisher 2003)

I have a brochure that I want to open in a new window so that if it gets
closed the site is still open
So I put the brochure in the same folder as the page that has its link
I inserted the following code fragment using publisher:

<Script Language="JavaScript">
function load() {
var load =
window.open('brochure.pdf','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>

Then on that page I set the hyperlink to read:

javascript:load()

That's it

The brochure opens in a new window

Spike

DavidF said:
Sorry, but I don't know the answer. Keep playing with the path until you
find the correct way to write it, I guess...

DavidF

AaronMor via OfficeKB.com said:
Hi Dave,
My website resides on a LAN server and therefore I have to use virtual
paths instead of http, does this make a difference. I entered in the
absolute
link like you stated but still received an error on page message. Please
advise on the best possible solution.

Aaron
Try using an absolute link in the code:

javascript:Show('http://www.yoursite.com/index_files/5x_retrofit.htm','newwindow','toolbar=no,
scrollbars=yes,resizable=yes,height=250,width=250')

This is assuming that you actually have a page "5x_retrofit.htm" on your
site.

DavidF

I have read all of these message boards and I can not get this to work.
I
have multiple webpages that have multiples spots where if the user
needs
[quoted text clipped - 18 lines]

Everytime I get an error on the page, what am I doing wrong???????
 
S

Spike

BTW: If you have more than one link on a page that you want to open in a
new window and some that you don't ... here is how I did that
Hope this helps you out.

For the FIRST LINK

<Script Language="JavaScript">
function load1() {
var load =
window.open('brochure_one.pdf','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>

Then on the page I set the hyperlink for brochure one to read:

javascript:load1()

For the SECOND LINK

<Script Language="JavaScript">
function load2() {
var load =
window.open('brochure_two.pdf','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>

Then on the page I set the hyperlink for brochure two to read:

javascript:load2()


Spike

DavidF said:
Sorry, but I don't know the answer. Keep playing with the path until you
find the correct way to write it, I guess...

DavidF

AaronMor via OfficeKB.com said:
Hi Dave,
My website resides on a LAN server and therefore I have to use virtual
paths instead of http, does this make a difference. I entered in the
absolute
link like you stated but still received an error on page message. Please
advise on the best possible solution.

Aaron
Try using an absolute link in the code:

javascript:Show('http://www.yoursite.com/index_files/5x_retrofit.htm','newwindow','toolbar=no,
scrollbars=yes,resizable=yes,height=250,width=250')

This is assuming that you actually have a page "5x_retrofit.htm" on your
site.

DavidF

I have read all of these message boards and I can not get this to work.
I
have multiple webpages that have multiples spots where if the user
needs
[quoted text clipped - 18 lines]

Everytime I get an error on the page, what am I doing wrong???????
 
A

AaronMor via OfficeKB.com

Thanks for the help. Everything is working now.
BTW: If you have more than one link on a page that you want to open in a
new window and some that you don't ... here is how I did that
Hope this helps you out.

For the FIRST LINK

<Script Language="JavaScript">
function load1() {
var load =
window.open('brochure_one.pdf','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>

Then on the page I set the hyperlink for brochure one to read:

javascript:load1()

For the SECOND LINK

<Script Language="JavaScript">
function load2() {
var load =
window.open('brochure_two.pdf','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}
// -->
</Script>

Then on the page I set the hyperlink for brochure two to read:

javascript:load2()

Spike
Sorry, but I don't know the answer. Keep playing with the path until you
find the correct way to write it, I guess...
[quoted text clipped - 27 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top