tutorial #20 :auto-open new tab

Okay , this one maybe sesuai untuk blog yg ada disabled right click dan yang seangkatan dengan nye ,sebab teramat lah parah kalau seseorang blogger tuh disabled right click kan blog dia nanti visitor susah nak open new tab , so lepas korang buboh benda alah ni mestu visitor korang senang hati ,
:face50:

:82:Design:83:Edit layout:84:Add a gadjet:82: Html javascript
And paste kan kod ini macam biasa okay . :face68:

<!-- code for turning all non-blog links to new page links -->
<script type="text/javascript" language="javascript">
var arr = document.getElementsByTagName("a"); //get all links in the page
for(var i = 0; i < arr.length; i++)
{
if(arr[i].href.indexOf("Your URL") < 0 //not links that are 'inside' blog
&& arr[i].href.indexOf("javascript:") < 0) //not javascript links
arr[i].target = "_blank";
}
</script>


Kemudian Save , :face67:
credits ; zuai

7 comments:

♥ syafiqah sanusi ♥ said...

Thanksssss. Hehe :DD

Anonymous said...

thanks ^^

Hana said...

xjadi la..url blog yang mana?

d4usx said...

baris ke-8 dari ats..

>>> if(arr[i].href.indexOf("Your URL") < 0 //not links that <<<

ade tulis "YOUR URL".. nk msukkn URL ape?

Apit said...

@d4usxOh yg itu paste aje , takpayah masuk kan apa2 URL

Tia said...

Thanks. Menjadik.

Unknown said...

thanks

Subscribe