Thứ Hai, 6 tháng 11, 2017

Code popup mở tab mới 1lần/1IP/1ngày cho website và blogspot

Chuyên mục:


Code popup mở tab mới 1lần/1IP/1ngày cho website và blogspot. Code popup nhảy ra tab mới khi truy cập vào web site hiện 1 lần duy nhât trong ngày trên cùng 1IP .

Đây là code popup sẽ giúp khách truy cập vào web của bạn bớt khó chịu hơn khi truy cập website của bạn. Cách thức hoạt động của nó như sau: Khi một người truy cập vào trang của bạn, khi click vào vị trí bất kì trong trang sẽ mở ra một trang web qua tab mới. Cũng trong ngày hôm đó mà họ vào thì sẽ không xuất hiện, không tạo cảm giác khó chịu khi sử dụng.

Cách chèn Code

- Đối rất đơn giản bạn chỉ cần truy cập vào trang code của web tìm thẻ </body> rồi thêm đoạn code phía dưới vào

- Các bạn sửa link http://win9se.blogspot.com thanh link web bạn muốn nó nhảy ra tab mới nhé

<script type="text/javascript">
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
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=Mon, 11-November-1989 00:00:01 GMT";
}
function popunder() {
if (Get_Cookie('cucre') == null) {
Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
var url = "http://win9se.blogspot.com";
pop = window.open(url, 'windowcucre');
pop.blur();
window.focus();
}
}
function addEvent(obj, eventName, func) {
if (obj.attachEvent) {
obj.attachEvent("on" + eventName, func);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, func, true);
}
else {
obj["on" + eventName] = func;
}
}
addEvent(window, "load", function (e) {
addEvent(document.body, "click", function (e) {
popunder();
});
});
</script>

0 nhận xét:

Đăng nhận xét