Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Web Design / April 2008

Tip: Looking for answers? Try searching our database.

TAG Open in a new window and/or tab

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paulo - 26 Apr 2008 20:40 GMT
I have my page www.techna.pt almost ready nbut there re a few links i would
like to put (as default) opening in a new window (somethink like _Blank in
HTML code)
It can be done??
Thanks!
DavidF - 27 Apr 2008 14:42 GMT
Reference:
http://office.microsoft.com/en-us/publisher/HA011587451033.aspx
describes two methods.

And if you choose to use the ECMAScript code approach note that the first
javascript code snippet is incorrect on the website. Use this instead:

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

DavidF

>I have my page www.techna.pt almost ready nbut there re a few links i would
> like to put (as default) opening in a new window (somethink like _Blank in
> HTML code)
> It can be done??
> Thanks!
Rob Giordano (Crash) - 27 Apr 2008 16:23 GMT
there is no way to force an open in new tab

Signature

~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression

> I have my page www.techna.pt almost ready nbut there re a few links i
> would
> like to put (as default) opening in a new window (somethink like _Blank in
> HTML code)
> It can be done??
> Thanks!
Paulo - 27 Apr 2008 17:38 GMT
Well, Thanks for the answer. I was able to make it work wit HTML code, but
is a mess to align the text.
I tried to use the ECMAS Script but it doesn't work. May be someone can tell
me in other words because my English is just ok, but not great. I am
Portuguese. Thank you very much!
DavidF - 28 Apr 2008 14:01 GMT
Getting the ECMAScript code to work correctly can be a bit tricky, but once
you get it working it is probably a better way. Perhaps part of the problem
is that English is not your first language, so let me explain in more
detail.

Reference:
http://office.microsoft.com/en-us/publisher/HA011587451033.aspx

Under the ECMAScript code approach, look at item 2. This first
javascript code snippet is incorrect on the website. Instead of:

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

Copy and paste the following into a code fragment box instead:

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

Move that code fragment box into an area on your page where it won't get in
the way.

Now then I would suggest that you create a text box and drag it off into
your scratch area (the gray area around your working page), and use this
text box to create and write your link codes. Set the font to Courier. It is
really easy to miss a space, a " or something else in the code snippet, so
having one code snippet that does work to use as a "template" for other
links helped me make less errors. Once you build your link in the text box,
then you can just copy and paste it into the hyperlink dialog. Also start
off with a simple "open in a new window" link. Here is one that will work:

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

Just change out "google.com" with the URL of the site that you want to open
in a new window. Then copy that line of script, select the text that you
want to hyperlink, right click, hyperlink, and just hit Ctrl + V to paste
the line of script into the address field. Then do a web page preview and
and test the link. Now once you have one working, you can just go back to
that "template" script and paste in other URLs and easily copy and paste
into the hyperlink dialog.

After you get just the open new window functioning, then you can go back and
start adding and changing the features  or attributes of the new browser
window. Just add one feature/attribute at a time, and test as you go. Like I
said, it is really easy to make a mistake.

Hope these added instructions will help.

DavidF

> Well, Thanks for the answer. I was able to make it work wit HTML code, but
> is a mess to align the text.
> I tried to use the ECMAS Script but it doesn't work. May be someone can
> tell
> me in other words because my English is just ok, but not great. I am
> Portuguese. Thank you very much!
Mike Koewler - 28 Apr 2008 15:06 GMT
David,

A question. Why use javascript instead of a simple link:

<a href='http://stjamesotv.com' target='_blank'>My Page</a>
in a code fragment? (Change the single quotes to double quotes)

Mike

> Getting the ECMAScript code to work correctly can be a bit tricky, but once
> you get it working it is probably a better way. Perhaps part of the problem
[quoted text clipped - 53 lines]
>>me in other words because my English is just ok, but not great. I am
>>Portuguese. Thank you very much!
DavidF - 28 Apr 2008 16:15 GMT
Hi Mike,

That is one of the two methods discussed in the article, and the method the
OP has been able to make work. There are times when it would be the best
choice...perhaps if you were adding just one "read more" link and putting
that code fragment box right after a text box, or something like that.
However, the javascript method allows the user to insert a hyperlink that
will open the new window by inserting the hyperlink in a word in an existing
text box just it is normally done. You can't use the code fragment method
you suggest to insert a hyperlink in an word in an existing text box. And
for what its worth, the code fragment method as written would take on the
default font format of the page for the text "My Page", which may or may not
be the preferred font or preferred size. So you would have to add font
formatting and font sizing code to the code fragment to get something other
than the default font and font size. Does that answer the question?

DavidF

> David,
>
[quoted text clipped - 64 lines]
>>>me in other words because my English is just ok, but not great. I am
>>>Portuguese. Thank you very much!
Mike Koewler - 28 Apr 2008 18:16 GMT
David,

Totally and completely!

Mike

> Hi Mike,
>
[quoted text clipped - 82 lines]
>>>>me in other words because my English is just ok, but not great. I am
>>>>Portuguese. Thank you very much!
Paulo - 28 Apr 2008 19:33 GMT
> >>><script language="JavaScript" type="text/javascript">function Show(Url,
> >>>Name, Features) { window.open(Url, Name, Features); }</script>

> >>>javascript:Show('http://www.google.com/','newwindow','')
IT WORKS NOW!! Thak you! This scrip up here works fine.!
DavidF - 30 Apr 2008 00:28 GMT
Glad to hear it. Thanks for posting back.

DavidF

>> >>><script language="JavaScript" type="text/javascript">function
>> >>>Show(Url,
>> >>>Name, Features) { window.open(Url, Name, Features); }</script>
>
>> >>>javascript:Show('http://www.google.com/','newwindow','')
> IT WORKS NOW!! Thak you! This scrip up here works fine.!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.