Opening External Links In New Window
Their are a few codes out their that will open links in a new window but for most people they just want external links to be the target. With this script below you can open external links in a new window without implanting multiple codes in every link. This will only work if the viewer has JavaScript enabled!
Place this code just under the <head> tag in your template.
The blue text should be the number of the characters (including http:// and .com) that you just placed in for the red text.
Source : http://www.tweakmyblogger.com/2011/09/opening-external-links-in-new-window.html
Place this code just under the <head> tag in your template.
The red text needs to be the link to your homepage (exactly).
<script type='text/javascript'>
//<![CDATA[
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=anchors.length-1; i>=0; i--) {
var anchor = anchors[i];
if (anchor.href && anchor.href.substr(0,Number) != "Homepage URL")
anchor.target = "_blank";
}
}
window.onload = externalLinks;
//]]>
</script>
The blue text should be the number of the characters (including http:// and .com) that you just placed in for the red text.
Source : http://www.tweakmyblogger.com/2011/09/opening-external-links-in-new-window.html
0 comments :
Silakan Bekomentar.!!!
Semakin banyak berkomentar, semakin banyak backlink, tapi jangan spam atau post komentar yang berhubungan pornografi!!!
:7: :8: :9: :10: :11: :12:
Post a Comment