[ List Archives Home ] [ Thread index for 2008 ] [ Date index for 2008 ] [ Author index for 2008 ]


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
We've developed a JavaScript kludge for this. Not pretty, but it works and degrades gracefully. YMMV. One dependency: the Prototype JS Framework, for the getElementsByClassName function. We stick the following in our botlogo.html:

<script language="javascript" src=" <<< path/to/prototype.js >>> ">
<!--
/**** This script is an include for the Prototype JavaScript Framework - http://www.prototypejs.org/ ****/
// -->
</script>
<script language="javascript">
<!--
/**** This script requires the Prototype JavaScript Framework - http://www.prototypejs.org/ ****/
/**** This script sets target to '_blank' in 856 links, to make open in a new window/tab ****/

// Make collections of link containers using class names
browseLinkDivs = document.getElementsByClassName('briefcitActions');
bibLinkTables = document.getElementsByClassName('bibLinks');

// Cycle through the collections, and replace all instances of '<a' with '<a target="_blank"'
for ( i = 0; i < browseLinkDivs.length; i++ ) {
browseLinkDivs[i].innerHTML = browseLinkDivs[i].innerHTML.replace(/<a /i, "<a target=\"_blank\" ");
}

for ( j = 0; j < bibLinkTables.length; j++ ) {
if ( bibLinkTables[j].cells ) { // innerHTML of <table> is read-only in IE; use .cells collection instead
for ( k = 0; j < bibLinkTables[j].cells.length; k++ ) {
bibLinkTables[j].cells[k].innerHTML = bibLinkTables[j].cells[k].innerHTML.replace(/<a /i, "<a target=\"_blank\" ");
}
} else {
bibLinkTables[j].innerHTML = bibLinkTables[j].innerHTML.replace(/<a /i, "<a target=\"_blank\" ");
}
}
// -->
</script>


Yitzchak Schaffer
Systems Librarian
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x230
Fax (212) 627-3197
yitzchas at touro dot edu


Deb Bergeron wrote:
Anyone been able to have the 856 open in a new window and still have the link go to the correct url, such as Serials Solutions?

Thanks,

Deb


--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---