Closed GoogleCodeExporter closed 8 years ago
Here's how I added the target attribute to this. I have no idea if this is the
best
approach however it works. Please let me know if you see any improvements:
at line ~233 I added:
var link = this.editorDoc.getElementsByTagName('a');
if(link) {
for(i = 0; i < link.length; i++) {
link[i].setAttribute('target', '_blank');
}
}
This will append the target attribute to each link created in the text.
Original comment by zelaferr...@gmail.com
on 4 Dec 2009 at 10:09
More jQueried code:
$('a', this.editorDoc).attr('target', '_blank);
But I prefer to do it at server side.
Original comment by akzhan.a...@gmail.com
on 5 Dec 2009 at 7:13
And more smart one is:
$('a[href^="http://"]').attr('target', '_blank');
Original comment by akzhan.a...@gmail.com
on 8 Dec 2009 at 11:59
Original issue reported on code.google.com by
thuy...@gmail.com
on 27 Jan 2009 at 10:18