Return to Snippet

Revision: 3435
at July 24, 2007 08:24 by donnies38


Initial Code
function doStandardsCompliantExternalLinks() {
	if (!document.getElementsByTagName) {return;}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") {// for example: title="Download Adobe Reader" rel="external"
			anchors[i].target = "_blank";
			anchors[i].title += " - Opens in new window";
		}
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
Standards Compliant Open in new Window

Initial Tags
window

Initial Language
JavaScript