12 Feb 2010

Buka Link External Di Halaman Baru

Kita dapat menggunakan sebuah script untuk membuka di halaman baru.
Berikut caranya :
  1. Layout --> Edit HTML.
  2. Cari kode di bawah ini :
]]></b:skin>
      3.  Copy dan paste kan kode berikut ini di bawahnya :
 
<script language='javascript'>
var dominio = "www.yourblog.blogspot.com";
var dominio1 = "yourblog.blogspot.com";
var script = "javascript:void(0);";
var imagenesblogger0 = "bp0.blogger.com";
var imagenesblogger1 = "bp1.blogger.com";
var imagenesblogger2 = "bp2.blogger.com";
var imagenesblogger3 = "bp3.blogger.com";
var blogger1 = "www.blogger.com";
var blogger2 = "www2.blogger.com";
var publicidad = "pagead2.googlesyndication.com";
function LinksExternos() {
var Externo;
if (document.getElementsByTagName('a')) {
for (var i = 0; (Externo = document.getElementsByTagName('a')[i]); i++) {
if (
Externo.href.indexOf(dominio) == -1 &amp;&amp;
Externo.href.indexOf(dominio1) == -1 &amp;&amp;
Externo.href.indexOf(script) == -1 &amp;&amp;
Externo.href.indexOf(imagenesblogger0) == -1 &amp;&amp;
Externo.href.indexOf(imagenesblogger1) == -1 &amp;&amp;
Externo.href.indexOf(imagenesblogger2) == -1 &amp;&amp;
Externo.href.indexOf(imagenesblogger3) == -1 &amp;&amp;
Externo.href.indexOf(publicidad) == -1 &amp;&amp;
Externo.href.indexOf(blogger1) == -1 &amp;&amp;
Externo.href.indexOf(blogger2) == -1
)
{
Externo.setAttribute('target', '_blank');
//Externo.setAttribute('class', 'linkexterno');
}
}
}
window.onload = function() {
LinksExternos();
}
</script>
      4.  Ganti tulisan yang di stabilo kuning dengan nama blog anda.
      5.  Save.

Tidak ada komentar:

Posting Komentar