Tuesday, August 16, 2011

Open Link New Tab

Salam Sayang Buat Semua...


jom buat tutorial lagi...tutorial kali nie adalah cara nak buat open link new tab...bila korang tekan sebarang link,dye akan muncul pada link yang baru...

okeyh, tak nak cakap panjang-panjang...jom kita try buat k...

pergi kat Page Elemet > add gadjet > HTML/ JAVASCRIPT

Masukkan kod kat bawah nie kat HTML/ Javascript

<!-- 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>


Your URL: letak URL blog korang yek...


Lepas tu save je!!

Selamat mencuba!!!




















Enjoy Your Reading My dear! ^__^

No comments:

LinkWithin

Related Posts Plugin for WordPress, Blogger...