An Trần Digital
No Result
View All Result
Chủ Nhật, Tháng Năm 11, 2025
  • Thủ thuật
    • Blogspot/Blogger
    • Phần Mềm
    • WordPress
    • Plugin WordPress
  • Đồ hoạ
    • Action Photoshop
    • Preset Camera Raw
    • Preset Lightroom Mobile
    • Preset Lightroom PC
  • Themes
    • Blogger/Blogspot
    • WordPress
  • Khoá học miễn phí
    • Adobe
    • Kỹ Năng Đời Sống
    • Lập Trình – Web
    • Marketing – SEO
  • Source Code
  • Mã giảm giá Shopee, Tiki
Ủng hộ tôi
An Trần Digital
  • Thủ thuật
    • Blogspot/Blogger
    • Phần Mềm
    • WordPress
    • Plugin WordPress
  • Đồ hoạ
    • Action Photoshop
    • Preset Camera Raw
    • Preset Lightroom Mobile
    • Preset Lightroom PC
  • Themes
    • Blogger/Blogspot
    • WordPress
  • Khoá học miễn phí
    • Adobe
    • Kỹ Năng Đời Sống
    • Lập Trình – Web
    • Marketing – SEO
  • Source Code
  • Mã giảm giá Shopee, Tiki
No Result
View All Result
An Trần Digital
No Result
View All Result

Home - Thủ thuật Blogspot/Blogger - Cách tạo popup thông báo khi thoát Website/Blog

Cách tạo popup thông báo khi thoát Website/Blog

by An Tran
08/07/2020
in Thủ thuật Blogspot/Blogger
Reading Time: 3 mins read
A A
0
cach-tao-popup-thong-bao-khi-thoat-website-blog-antrandigital
40
SHARES
500
VIEWS

Nay mình sẽ hướng dẫn mọi người làm thế nào tạo popup thông báo khi thoát website/blog. Thì popup này xuất hiện khi có người vào truy cập vào website/blog của chinh mình thì khi thoát sẽ hiện thông báo hỏi có chắc muốn thoát không? hoặc các bạn có thể tận dụng popup này để gửi lời cám ơn mọi người đã đến website & chút một ngày tốt lành !!!.

Cách thực hiện:

  • Bước 1: Đăng nhập vào Blogger
  • Bước 2: Chọn Mẫu -> Tuỳ chỉnh HTML
  • Bước 3: Tiếp theo copy toàn bộ đoạn script này và thêm trước thẻ </head>
  • Bước 4: Sau đó bạn sửa dòng text thông báo CÁM ƠN CÁC BẠN ĐÃ ĐẾN VỚI AN TRẦN DIGITAL thay theo ý của bạn.

Xem thêm: Tạo xếp hạng bình luận cho Blogger/Blogspot

Để duy trì blog ngoài link rút gọn & mình có làm aff cho 1 số bên hosting.

Các nhà cung cấp uy tín về mặt chất lượng & đội ngũ support nên mọi người cứ yên tâm.

Nếu bạn đang có ý định mua Hosting, VPS mình có list dưới đây các bạn click vào link trước khi mua để ủng hộ mình nhé. Mình cảm ơn nhiều

  • Azdigi: Giá rẻ thì dùng gói Pro Gold Hosting còn chất lượng hơn thì em khuyên dùng Business Hosting. Có điều kiện thì lên VPS nhé
  • Tino: Business Hosting, NVMe Hosting và NVMe VPS
  • iNet: Cloud VPS và Web Hosting
<script> var exittraffic_splashalertmessage = "CÁM ƠN CÁC BẠN ĐÃ ĐẾN VỚI AN TRẦN DIGITAL"; </script>
<script type='text/javascript'>
//<![CDATA[
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;

function DisableExitTraffic() {
PreventExitSplash = true;
}

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}
else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
function addClickEvent(a, i, func) {
if (typeof a[i].onclick != 'function') {
a[i].onclick = func;
}
}
theBody = document.body;
if (!theBody) {
theBody = document.getElementById("body");
if (!theBody) {
theBody = document.getElementsByTagName("body")[0];
}
}
var PreventExitSplash = false;
var LightwindowOpening = false;
function DisplayExitSplash() {

if (PreventExitSplash == false) {


window.scrollTo(0, 0);
if (is_firefox) {
//window.alert(exittraffic_splashalertmessage);
}
PreventExitSplash = true;
if (is_chrome||is_firefox) {
timeout_variable = setTimeout("exittraffic_change_url();", 1000);
} else {
document.location.href = exittraffic_RedirectUrl;
}

return exittraffic_splashalertmessage;
}
}
var a = document.getElementsByTagName('A');
for (var i = 0; i < a.length; i++) {
if (a[i].target !== '_blank') {
addClickEvent(a, i, function() {
PreventExitSplash = true;
});
}
else {
addClickEvent(a, i, function() {
PreventExitSplash = false;
});
}
}
disablelinksfunc = function() {
var a = document.getElementsByTagName('A');
for (var i = 0; i < a.length; i++) {
if (a[i].target !== '_blank') {
addClickEvent(a, i, function() {
PreventExitSplash = true;
});
}
else {
addClickEvent(a, i, function() {
PreventExitSplash = false;
});
}
}
}

addLoadEvent(disablelinksfunc);

disableformsfunc = function() {
// Makes that clicking on the links on the page will not cause this popup to appear
var f = document.getElementsByTagName('form');
for (var i = 0; i < f.length; i++) {
if (!f[i].onclick) {
f[i].onclick = function() {
if (LightwindowOpening == false) {
PreventExitSplash = true;
}
}
}
else if (!f[i].onsubmit) {
f[i].onsubmit = function() {
PreventExitSplash = true;
}
}
}
}

function exittraffic_change_url() {
disable_confirmation = false;
clearTimeout(timeout_variable); // just to make sure
document.location.href=exittraffic_RedirectUrl;
}

addLoadEvent(disableformsfunc);
window.onbeforeunload = DisplayExitSplash;
//]]>
</script>

CHÚC CÁC BẠN THÀNH CÔNG !!!

Tags: tạo popup thông báo thoát websitethủ thuật blogger
Previous Post

15 website giúp bạn xả stress hiệu quả trong công việc

Next Post

Chia sẻ N Light Pro 6 Responsive Blogger Template chuẩn SEO

An Tran

An Tran

Tôi là An Trần, thuộc thế hệ 9X. Hiện tại đang làm nhân viên cắt cỏ tại sân Old Trafford.

Related Posts

Tự động thêm nofollow cho liên kết ngoài trong blogspot

Tự động thêm nofollow cho liên kết ngoài trong blogspot

30/10/2024
cách hiển thị thời gian đọc bài viết trên website

Cách hiển thị thời gian đọc bài viết trên website

06/06/2024
Tạo khung chứa code chuyên nghiệp cho blogspot

Tạo khung chứa code chuyên nghiệp cho blogspot

14/01/2024
Cách vô hiệu hoá copy, chuột phải & các phím chức năng

Cách vô hiệu hoá copy, click chuột phải & các phím chức năng cho website

09/01/2024
Next Post
n-light-responsive-blogger-template-antrandigital

Chia sẻ N Light Pro 6 Responsive Blogger Template chuẩn SEO

Subscribe
Notify of
guest

Hãy dùng tên của bạn khi comment, không sử dụng keyword trong ô Tên. Xin cảm ơn!

guest

Hãy dùng tên của bạn khi comment, không sử dụng keyword trong ô Tên. Xin cảm ơn!

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

BÀI VIẾT NGẪU NHIÊN

valorant-Riot-Games-antrandigital

Hướng dẫn tạo tài khoản chơi game Valorant Riot

03/07/2020
Cách ẩn widget trên giao diện điện thoại cho website wordpress an trần digital

[WordPress] Cách ẩn Widget trên giao diện mobile cho website

05/01/2022
khoa-hoc-adobe-indesign-toan-tap-antrandigital

Chia sẻ khoá học Adobe InDesign CC toàn tập

12/07/2020
tao-hieu-ung-cho-anh-pro-oil-paint-photoshop-action-antrandigital

Tạo hiệu ứng cho ảnh – Pro Oil Paint Photoshop Action

15/01/2021

HOSTING / VPS KHUYÊN DÙNG

logo azdigi

Hosting WordPress chất lượng cao. Support tốt 24/7. Xem ngay

logo inet

Nhà cung cấp hosting, tên miền có lâu đời ở Việt Nam. Xem ngay

logo tinohost

Hosting WordPress chất lượng cao. Support tốt. Dùng thử 7 ngày. Click để nhận mã giảm 10% ngay. Xem ngay


An Trần Digital là blog cá nhân chia sẻ preset lightroom, camera raw từ máy tính đến mobile, template blogspot, theme wordpress và các khoá học khác hoàn toàn miễn phí.

DMCA.com Protection Status

Comments gần đây

  • An Tran
    Quản lý
    trong Share Key Screaming Frog SEO Spider
  • gia cat luoing trong Share Key Screaming Frog SEO Spider
  • An Tran
    Quản lý
    trong Share Key Screaming Frog SEO Spider

Xem nhiều nhất ngày

Share Key Screaming Frog SEO Spider

Code hiệu ứng hoa mai rơi cho blog/website

Về An Trần Digital

Giới thiệu về tôi

Bảo mật

Hợp tác

Bản quyền

Liên hệ

Donate

© 2020 An Trần Digital - All Rights Reserved

No Result
View All Result
  • Thủ thuật
    • Blogspot/Blogger
    • Phần Mềm
    • WordPress
    • Plugin WordPress
  • Đồ hoạ
    • Action Photoshop
    • Preset Camera Raw
    • Preset Lightroom Mobile
    • Preset Lightroom PC
  • Themes
    • Blogger/Blogspot
    • WordPress
  • Khoá học miễn phí
    • Adobe
    • Kỹ Năng Đời Sống
    • Lập Trình – Web
    • Marketing – SEO
  • Source Code
  • Mã giảm giá Shopee, Tiki

© 2020 An Trần Digital - All Rights Reserved

wpDiscuz

Đồng ý sử dụng cookie

Những cookie này giúp trang web ghi nhớ thông tin về lần truy cập của bạn. Nhờ đó, bạn có thể truy cập trang web này dễ dàng hơn vào lần tới và trang web cũng trở nên hữu ích hơn cho bạn. Tìm hiểu thêm