How do I create hyperlink to open target in a "new window"

C

Chris 34982

I'm using Publisher 2003 to turn my print newsletter into a website, and want
to create hyperlinks within the website that open "new windows" instead of
taking someone out of my website.
I have tried the ECMAScript code approach (which seems perfect for what
I want) that I found in MS Office Asst. Answer Box, written by Connie Miller.
When I check to see if it worked properly, I only get an "ERROR ON PAGE"
message in the bottom left corner of the browser window.
Perhaps there's an error in the script, but I have no clue about
that..! Can anyone suggest different script code or another approach?
Help...
 
C

Chris 34982

Tried the approach as described in Q#7 of the FAQ, but that doesn't work well
for me on a page that has numerous hyperlinks. I want to use the ECMAScript
approach described on the MS OFFICE Asst. page:
http://office.microsoft.com/en-us/assistance/HP030805631033.aspx .
Unfortunately, when I use the script supplied on that page (for the
ECMAScript approach) I get an ERROR ON PAGE message on the status bar of my
webpage. (The html code approach supplied there works alright, but is very
difficult to inplement on my webpage.)

Could someone tell me if there is an error in the script, as I think there
must be since I copy and paste it directly from the MS webpage... and I do
follow the instructions carefully!

Thanks...
Chris
 
D

DavidF

If you want someone to tell you what your code error is, please provide the
URL.

In the meantime you could read through the thread 'Opening picture in new
window' 7/28/05 for alternative sources for script. You can also Google for
the script and find lots of sources. Study the alternative code to perhaps
find the solution to your code issues. Another resource often given is
http://www.htmlgoodies.com .

DavidF

Chris 34982 said:
Tried the approach as described in Q#7 of the FAQ, but that doesn't work well
for me on a page that has numerous hyperlinks. I want to use the ECMAScript
approach described on the MS OFFICE Asst. page:
http://office.microsoft.com/en-us/assistance/HP030805631033.aspx .
Unfortunately, when I use the script supplied on that page (for the
ECMAScript approach) I get an ERROR ON PAGE message on the status bar of my
webpage. (The html code approach supplied there works alright, but is very
difficult to inplement on my webpage.)

Could someone tell me if there is an error in the script, as I think there
must be since I copy and paste it directly from the MS webpage... and I do
follow the instructions carefully!

Thanks...
Chris

David Bartosik said:
Q # 7 on the FAQ -
http://www.publishermvps.com/Default.aspx?tabid=30

David Bartosik - [MSFT MVP]
 
C

Chris 34982

Thanks for the response, DavidF. I have checked the other thread you
mentioned, have originally GOOGLED to find the MS Office Asst. pages that I
mentioned, and the URL for the one page is included in the middle of my last
message. Here's the URL for the other page tha includes the same info:
http://office.microsoft.com/en-us/assistance/HA011587451033.aspx

I've gone to www.htmlgoodies.com but have not (yet) found that to be of help
with the particular issue I'm having with Publisher 2003 and the ECMAScript
approach.

I did find a discussion in one of the threads that indicated "copy & paste"
of a script may lead to problems with quotation marks (") not being read
properly and have typed the script in myself... but did not find that to make
a difference.

Chris 34982
 
D

DavidF

Chris 34982,

I'm sorry. I meant to post the URL of YOUR webpage where you inserted the
script, not the original source of the script. It would seem that you have
made an error in the script that you inserted, or typed yourself, and the
best way for someone to trouble shoot that is to see the code on the page
where you inserted it. In fact, I am not that great at trouble shooting
code, but our resident MVP David Bartosik is, and if you post the URL to
your webpage, I am sure he, or someone else will spot the problem if I
don't. Alternatively, if you don't have the page posted, you could paste the
exact code from your Insert HTML code fragment box, in a reply...that might
be enough. Just open the code fragment box, select all, and use your Ctrl +
C keys to copy it.

DavidF
 
G

glenngroves

Hi,

The problem with the script on page HP030805631033.aspx is that it includes
'comment out' code, meant to prevent older browsers from displaying the
script as HTML. The script does work if you remove the 'comment out' code.

The script on page HP030805631033.aspx is: <script language="JavaScript"
type="text/javascript"> <!-- function Show(Url, Name, Features) {
window.open(Url, Name, Features); } // --> </script>.

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

This is the same script, but without the 'comment out' code of <!-- and //
-->.

I do not know why the 'comment out' code causes this problem... but the code
does work without the 'comment out' code, and if anyone is using such an old
browser that it does not understand javascript, then it is way past time for
them to upgrade browsers anyway...

Cheers,

Glenn
 
C

Chris 34982

Hi Glen..

Thanks for the help with this issue! I'd, indeed, given up on finding a
solution and had resorted to, once again, using an older version of Publisher
to generate the newsletterand then editing with FrontPage to take care of the
"New Window" concern.

Thanks, again..
Chris
 
R

Roy Pledger

Hi Glenn

I am new to web design and have found exactly the problem which you have
resolved. You probably heard me shout Yessss... this morning when it worked.

Many thanks for your help.

Roy P
 
B

Benjy88

Hi Glenn,

I am both impressed by the fact that I managed to find your answer after
only a few minutes searching and at the same time frustrated that the
original help article has not been updated. It's nearly two years since
Chris posted his first plea for help.

I'm sure for every Roy and Chris, there are hundreds of others who don't
find the answer. None the less, like Roy, I say thank you and Yessss!

Ben
 
C

coreynahman

Here's what I would do:

Insert the following HTML snippet toward the top of the page:

<!-- all windows open up in new windows //-->
<base target="_blank">

BTW: I am happy I found this group. I have been publishing a 225 page
site using publisher 98 for the past 7 years.
My site does 6000 page views per month. Publisher can do many things.

Corey Nahman, Publisher
internet_drug_news_inc
 

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