Nơi chia sẽ kiến thức về CNTT
thủ thuật Blogger, thủ thuật AutoIT
Imacross, VBA cho Excel

5 thg 6, 2013

Script tự động bật Popup quảng cáo cho blog

Đoạn mã javascript tự động mở cửa sổ Popup
Đăng nhập cào blogger Bước 2: vào mục Template => EditHTML chép đè đoạn mã bên đưới lên thẻ lên thẻ <body>
 <body onclick="popunder();">

<script type="text/javascript">
/* <![CDATA[ */
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());

if (expires) {
expires = expires * 1000 * 60 * 60 * 12;
}
var expires_date = new Date(today.getTime() + (expires));

document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

function Get_Cookie(name) {

var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
return null;
}
if (start == -1) return null;
var end = document.cookie.indexOf(";", len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len, end));
}

function Delete_Cookie(name, path, domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function popunder() {
if (Get_Cookie('vnsTraGopLT6')) {
return false;
}
else {
Set_Cookie('vnsTraGopLT6', 'vnsTraGopLT PopUnder', '1', '/', '', '');
urls =['http://adfoc.us/10822024290586', /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312577',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312585',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312577',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312597',  /* thay bằng đường dẫn của bạn*/

      ];

for (var i=0; i< urls.length; i++)
{
    window.open(urls[i])
}
}
}
/* ]]> */
    </script>
---------------------------
note: Thay các đường link màu đỏ bằng đường link của bạn, bạn muốn mở bao nhiêu trang là tùy ý, chỉ cần thêm đường link vào trong mảng urls theo cấu trúc sau:
urls=['link 1','link2',...,'linkn'] rất đơn giản.
Đoạn mã này chỉ mở popup mỗi IP chỉ mở một lần trong vòng 24 h,
Nếu như bạn nào muốn không kiểm tra IP thì chỉ cần lấy đoạn sau:
<body onclick="popunder();">

<script type="text/javascript">
function popunder() {
urls =['http://adfoc.us/10822024290586', /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312577',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312585',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312577',  /* thay bằng đường dẫn của bạn*/
      'http://adfoc.us/10822024312597',  /* thay bằng đường dẫn của bạn*/

      ];

for (var i=0; i< urls.length; i++)
{
    window.open(urls[i])
}
}
/* ]]> */
    </script>
-----------------------------------------------------------------------------
Nhấn vào đây để thử Test
 Đoạn mã này tui copy trên mạng, có viết lại một vài chỗ không nhớ rõ nguồn
Mong các bạn thông cảm.
-------------------------------------------
Chúc các bạn thành công!
Chủ bút: tienluidl

Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 nhận xét

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© 2016 Blog kiến thức
Designed by blgkienthuc.blogspot.com Cooperated with blgkienthuc.blogspot.com/
Released under Creative Commons
Posts RSSComments RSS
Back to top