Thread: targets
View Single Post
Old 07-07-2003, 12:17   #8 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,962
external.js
Code:
function blankLinks( evt ) { var o = ( evt ) ? evt.target: event.srcElement; if ( o.nodeName != 'A' ) return; o.target = "_blank"; }

markup
Code:
<td onclick="blankLinks( event );"> ...cms content... </td>

I'd been discussing the problem with a copule of cohorts from SPf and though this is not the way I was primary thinking the problem would be solved, it's a sound method.

How it works:

Whenever the <td> (incl. its contents) are clicked, the script kicks in to assess whether the object that was clicked was an anchor tag <a>.

If it is then it immediately assigns target="_blank" to the tag and the link targets a new blank window.

If the clicked element isn't a tag, it does nada.


Hope that helps ya.


[edit]

Just tested and failed in Opera

[/edit]

'Plan B'?
  Reply With Quote