new window for a hyperlink

  • Thread starter All Phases Contracting
  • Start date
A

All Phases Contracting

How do i get a document (PDF) or another page to open in a different window?

Exp: Building my web page and want to link to some references (pdf) and have
this link open in a different window. Im using publisher 07

Please help
 
D

DavidF

There are a number of ways to do this, and this article describes two:
Reference: http://office.microsoft.com/en-us/publisher/HA011587451033.aspx

The ECMAScript code approach is more versatile, but there is an error in the
code. Under item 2, instead of the following:

<script language="JavaScrip­t" type="text/javascri­pt"> <!-- function
Show(Url, Name, Features)
{ window.open(Url, Name, Features); } // --> </script>

use this snippet instead:

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

If you have any follow up or new Publisher web questions, please post in the
webdesign group and we will try to help you there:
news://msnews.microsoft.com/microsoft.public.publisher.webdesign
or
http://www.microsoft.com/office/com...soft.public.publisher.webdesign&lang=en&cr=US

DavidF
 
A

ajsoftail

David,

I found, read and printed your detailed answer regarding the above that you
replied to back in May of 2008. I can't seem to get my pictures to open in
the new window. The window opens when I do a web page preview, but it is
blank. No image. Is this because I'm in web page preview and haven't
uploaded my files through ftp? Or is it perhaps a problem with the images1
folder that I made in the same directory as my index and index_files? The
larger images I basically made by opening my pictures in Adobe Imageready,
resizing and then optimizing and saving them to the images1 folder. I'm new
to website creation and know just enough about Publisher to be dangerous.

It's been a week and I am still trying to get these larger images to open so
I can upload my revamped site to the web. I'm losing business every day
without my site up, running and available to the world!!! Help!!!
 
D

DavidF

It sounds like you have the javascript correct as you are getting a new
window to open, but perhaps you are not writing the link to the larger
images correctly? If you are using a relative link, that would only work
after you uploaded the code to your server. Try writing a full link or path
to the images, such as this:

javascript:Show('http://www.yourdomain.com/images/yourimage.jpg','newwindow','')

(By the way, I create a text box in the scratch area of my publication and
write these 'links' there, and copy and paste into the code fragment
box...tis easier to avoid or spot errors.)

Make sure that you don't have spaces in the file name or path, match
case...probably use all lower case, and no special characters. How big is
the image file? A really large file will take a long time to load... Test
the link to the image outside of the javacript. Just copy and paste:
http://www.yourdomain.com/images/yourimage.jpg into the address field of
your browser...does your image load? If not then check to see if the image
is actually in the 'images' folder.

As I suggested in my last response, if you want to ask a follow up question
or other web related question, it is best to post in the web group so it
doesn't get missed.

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