Open In New Window - Doesn't Work!

D

dawnvk

Hello,

I have a page of links on my website. I want them to open in a new window
rather than having to have the person click the back button to get back to my
link page... common issue. I've read all the thread on this page. Here is
what I've done:

I am using Pub 2002. I used the insert code fragment to put this code in:
<script language="JavaScript" type="text/javascript">function Show(Url,
Name, Features) { window.open(Url, Name, Features); }</script>

I placed that at the top of my page. Then, I changed my link to URLs to be
as described...

javascript:Show('http://www.google.com/','newwindow','')

And I replaced the google.com w/my url.

The problem is, sometimes it works, sometimes it doesn't. Since I c&p, I
can't for the life of me figure out what's not right. One common thread I
found is I can't get any of them to work which are hosted on my server. I
don't know why.

Here is an example of one that won't work on my server:

javascript:Show('http://www.vkvboers.com/Parasites_in_goats.pdf/','newwindow','')

Here's an example of one that won't work on another server:

javascript:Show('http://jackmauldin.com/diseases.htm/','newwindow','')

The webpage address is: http://www.vkvboers.com/index_page0007.htm

Any suggestions would be much appreciated as my page is currently full of
nasty ugly broken links...

Thanks,

Dawnvk
 
D

dawnvk

I've solved my mystery... I had to remove the / in this part of the code:
/','newwindow','')

Now it works.

Sorry to be a bother...
 
S

Spike

Here is another script that works well:

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


Paste the following in the hyperlink dialog:

For local files:
javascript:Show('mypdf.pdf','')
For remote files / web addresses
javascript:Show('http://www.google.com,'')


Spike
 
D

dawnvk

Thanks Spike - I have a question though. When you're using the code on local
files, Pub 2002 doesn't give you an address line - you just choose "Place in
this document". How do you apply the code you suggest in this case?
Thanks,
Dawn
 
S

Spike

What I referred to was placing a file (as in a PDF) in the same folder on
the sever that the web page is in and use:
javascript:Show('mypdf.pdf','')
for the hyperlink to the file
Example:
Highlight the text "Here is my PDF" and hyperkink it
In this case it would open up mypdf in a new window
Sorry if I confused you, I get a bit Terse in my explanations
If you had the mypdf file in another folder like downloads, it would look
like:
javascript:Show('/downloads/mypdf.pdf','')

And BTW thanks for posting back that you had found your problem on your
own . It helps us all.

Spike
 
D

DavidF

Dawn,

If you want to know what the link to the other pages in your site will be,
go to that page in your publication and do a web page preview. Look at the
end of the address in the address bar in your browser and that will tell you
what Publisher will name that page. In Pub 2003 and 2007 the page number is
arbitrary, but in Pub 2002, I THINK it names pages in the order they are in
your publication, and you do not have the option of a custom name. For
example the link to your links and info page that you provided:
http://www.vkvboers.com/index_page0007.htm is probably your seventh page.
So, if you are writing a link to the 9th page, it would be
http://www.vkvboers.com/index_page0009.htm. So rather than choosing a Place
in this document, just type or copy and paste an absolute link in the
address.

I prefer using absolute links vs. relative links. I make less mistakes that
way.

DavidF
 

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