Share js mở newtab

  • Thread starter Thread starter AdminAdmin is verified member.
  • Start date Start date
Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Tạo một file .js rồi dán code này vào
HTML:
function TUOITREVN_ADS_GetCookie(a){var b=new RegExp(a+"=[^;]+","i");if(document.cookie.match(b)){return decodeURIComponent(document.cookie.match(b)[0].split("=")[1])}return""}function TUOITREVN_ADS_SetCookie(b,c,e){if(typeof e!="undefined"){var a=new Date();var d=a.setDate(a.getDate()+e);document.cookie=b+"="+decodeURIComponent(c)+"; expires="+a.toGMTString()}else{document.cookie=b+"="+decodeURIComponent(c)}}function tuoitrevnbiz(){var b=TUOITREVN_ADS_GetCookie("ttvn_popup_ads");if(b){return false}else{var f=24*3600*1000;TUOITREVN_ADS_SetCookie("ttvn_popup_ads","true",f);var d=["http://tuoitreit.vn","http://whois.tuoitreit.vn","http://wapftp.tuoitreit.vn"]; var c=d[Math.floor(Math.random()*d.length)];var e="width=600";e+=", height=400";e+=", top=0,left=0,scrollbars=yes,status=1,toolbar=1,menubar=1,resizable=1,location=1,directories=1";var a=window.open(c,"hqth_ads_pop",e)}return false}function addEvent(c,a,b){if(c.attachEvent){c.attachEvent("on"+a,b)}else{if(c.addEventListener){c.addEventListener(a,b,true)}else{c["on"+a]=b}}}addEvent(window,"load",function(a){addEvent(document.body,"click",function(b){tuoitrevnbiz()})});
Sửa địa chỉ trong js thành url bạn muốn. Xong dán code dưới vào head.
HTML:
<script src="đường dẫn đến tập tin .js" language="javascript" type="text/javascript"></script>
Xong
 

Facebook Comments

Similar threads

cuongpro9x
Replies
0
Views
9K
cuongpro9xcuongpro9x is verified member.
cuongpro9x
Back
Top