Re: Opening hyperlinks in new or existing window

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks for the script David.
It's probably too far over my head, but I'll try it never the less.
I peruse the dynamicdrive website to see where to include and how to use.

Cheers,
tomZ

DavidF wrote:

G'day to you tomZ,

Thanks for your comments...

I am not sure if the following works or not. I haven't tested it, but ran across it sometime in the past and saved it in my "sample scripts" folder. If it doesn't work, perhaps it will lead you to an answer. If you do find a solution, let us know...

-----------------

Open offsite links in new window:

---------------

<script language="JavaScript1.2">
<!--

//Open offsite links in new window option- By Jessica Hammer
//Heavily modified by Dynamic Drive
//Visit http://www.dynamicdrive.com for this script

//1)Enter domains to be EXCLUDED from opening in new window:
var excludedomains=["dynamicdrive.com", "javascriptkit.com"]

//2)Automatically open offsite links in new window? (1=yes, 0 will render a checkbox for manual selection)
var auto=1

var excludedomains=excludedomains.join("|")
rexcludedomains=new RegExp(excludedomains, "i")

if (!auto)
document.write('<form name="targetmain"><input type="checkbox" name="targetnew" checked onClick="dynamiclink()">Open off-site links in new window</form>')

function dynamiclink(){

if (auto||(!auto&&document.targetmain.targetnew.checked)){
for (i=0; i<=(document.links.length-1); i++) {
if (document.links[i].hostname.search(rexcludedomains)==-1&&document.links[i].href.indexOf("http:")!=-1)
document.links[i].target="_blank"
}
}
else
for (i=0; i<=(document.links.length-1); i++) {
if (document.links[i].hostname.indexOf(mydomain)==-1)
document.links[i].target=""
}
}

if (auto)
window.onload=dynamiclink

// -->
</script>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com";>Dynamic Drive</a></font></p>

-----------------

DavidF

"tomZ" <WebMaster@xxxxxxxxx> wrote in message news:e797ie0m1c@xxxxxxxxxxxxxxxxxxxxx
G'day,
using Publisher 2000

I've read David Bartosik's "Hyperlinks that open a new browser window"
http://msmvps.com/blogs/dbartosik/archive/2006/01/13/81266.aspx
and reviewed postings in the n/g. I understand how to force links to open in a new window.

However.......
I thought I saw/read ?somewhere? that there was a "global" setting in MS Publisher that would set all links to open in new windows instead of the default 'current window'. Naturally, I may have been hallucinating (bad ice in my drinks ;), but if this sounds familiar to any one else, I'd appreciate any response.

Thanks again to DavidB and DavidF for contributing so much of your knowledge. Your, and all contributors', answers to posts are greatly appreciated.

Cheers,
tomZ

--
If you spam my mailbox, you agree to accept any response I deem appropriate.
Keep SIGNATURE AGREEMENT before replying.
"Any business model that relies on 'caveat emptor' is not ethical." (aka Sony)
This posting may not be reversed engineered. My keyboard is proprietary.





--
If you spam my mailbox, you agree to accept any response I deem appropriate.
Keep SIGNATURE AGREEMENT before replying.
"Any business model that relies on 'caveat emptor' is not ethical." (aka Sony)
This posting may not be reversed engineered. My keyboard is proprietary.

.