Tạo trang chờ chuyển hướng với liên kết ngoài blog cho Blogspot
Blogspot, TipsXin chào mọi người. Chắc hẳn đây là bài viết rất nhiều người mong đợi. Mặc dù nó đã được chia sẻ rất nhiều trên Google nhưng có lẽ với sự đơn giản, sự nhiệt tình, chu đáo trong cách viết bài đã khiến mọi người thích =))) (ahjhj tự khen :v)
Khi độc giả click vào link ngoài blog của bạn thì nó sẽ tự động chuyển hướng đến trang chờ chuyển hướng ! Mình cũng đã nghiên cứu JS của một số bài viết, mặc dù có lỗi nhưng mình đã tổng hợp và share, fix lại cho các bạn dùng ! Bắt đầu thôi.
Bước 2: Tạo 1 trang chuyển hướng trong blog của bạn và thay www.trongkhanhnguyen.com/redirect.php trong JS bước 1 thành link trang blog chuyển hướng vừa tạo
Bước 3: Vào trang chuyển hướng vừa tạo, chuyển sang HTML và thêm đoạn code sau vào trang:
<script> //<![CDATA[
shortcut = { all_shortcuts: {}, add: function(a, b, c) { var d = { type: "keydown", propagate: !1, disable_in_input: !1, target: document, keycode: !1 }; if (c) for (var e in d) "undefined" == typeof c[e] && (c[e] = d[e]); else c = d; d = c.target, "string" == typeof c.target && (d = document.getElementById(c.target)), a = a.toLowerCase(), e = function(d) { d = d || window.event; if (c.disable_in_input) { var e; d.target ? e = d.target : d.srcElement && (e = d.srcElement), 3 == e.nodeType && (e = e.parentNode); if ("INPUT" == e.tagName || "TEXTAREA" == e.tagName) return } d.keyCode ? code = d.keyCode : d.which && (code = d.which), e = String.fromCharCode(code).toLowerCase(), 188 == code && (e = ","), 190 == code && (e = "."); var f = a.split("+"), g = 0, h = { "`": "~", 1: "!", 2: "@", 3: "#", 4: "$", 5: "%", 6: "^", 7: "&", 8: "*", 9: "(", 0: ")", "-": "_", "=": "+", ";": ":", "'": '"', ",": "<", ".": ">", "/": "?", "\\": "|" }, i = { esc: 27, escape: 27, tab: 9, space: 32, "return": 13, enter: 13, backspace: 8, scrolllock: 145, scroll_lock: 145, scroll: 145, capslock: 20, caps_lock: 20, caps: 20, numlock: 144, num_lock: 144, num: 144, pause: 19, "break": 19, insert: 45, home: 36, "delete": 46, end: 35, pageup: 33, page_up: 33, pu: 33, pagedown: 34, page_down: 34, pd: 34, left: 37, up: 38, right: 39, down: 40, f1: 112, f2: 113, f3: 114, f4: 115, f5: 116, f6: 117, f7: 118, f8: 119, f9: 120, f10: 121, f11: 122, f12: 123 }, j = !1, l = !1, m = !1, n = !1, o = !1, p = !1, q = !1, r = !1; d.ctrlKey && (n = !0), d.shiftKey && (l = !0), d.altKey && (p = !0), d.metaKey && (r = !0); for (var s = 0; k = f[s], s < f.length; s++) "ctrl" == k || "control" == k ? (g++, m = !0) : "shift" == k ? (g++, j = !0) : "alt" == k ? (g++, o = !0) : "meta" == k ? (g++, q = !0) : 1 < k.length ? i[k] == code && g++ : c.keycode ? c.keycode == code && g++ : e == k ? g++ : h[e] && d.shiftKey && (e = h[e], e == k && g++); if (g == f.length && n == m && l == j && p == o && r == q && (b(d), !c.propagate)) return d.cancelBubble = !0, d.returnValue = !1, d.stopPropagation && (d.stopPropagation(), d.preventDefault()), !1 }, this.all_shortcuts[a] = { callback: e, target: d, event: c.type }, d.addEventListener ? d.addEventListener(c.type, e, !1) : d.attachEvent ? d.attachEvent("on" + c.type, e) : d["on" + c.type] = e }, remove: function(a) { var a = a.toLowerCase(), b = this.all_shortcuts[a]; delete this.all_shortcuts[a]; if (b) { var a = b.event, c = b.target, b = b.callback; c.detachEvent ? c.detachEvent("on" + a, b) : c.removeEventListener ? c.removeEventListener(a, b, !1) : c["on" + a] = !1 } } }, shortcut.add("Ctrl+U", function() { top.location.href = "//trongkhanhnguyen.com" }), shortcut.add("F12", function() { top.location.href = "//trongkhanhnguyen.com" }), shortcut.add("Ctrl+Shift+I", function() { top.location.href = "//trongkhanhnguyen.com" }), shortcut.add("Ctrl+S", function() { top.location.href = "//trongkhanhnguyen.com" }), shortcut.add("Ctrl+Shift+C", function() { top.location.href = "http://www.trongkhanhnguyen.com/" }); String.prototype.GetValue = function(t) { var e = new RegExp("(^|&)" + t + "=([^&]*)(&|$)"), n = this.substr(this.indexOf("?") + 1).match(e); return null != n ? unescape(n[2]) : null }; var str = location.href;
//]]> </script>
<style>.chuyen-huong-tkn {font-family: Roboto; width: 80%; margin: 0 auto; margin-top: 20px; padding: 10px; border: 1px solid #4080ff; border-radius: 5px}.chuyen-huong-tkn .title {width: 100%; font-size: 19px; color: #4080ff}.xac-nhan-tkn {background: #4080ff; border: 1px solid #4080ff; border-radius: 3px; padding: 4px; color: #fff!important; font-family: Roboto!important}.xac-nhan-tkn:before {content:'\f090';color:#FF0080; font-family: fontawesome}.back-home-ch-tkn {background: #4080ff; border: 1px solid #4080ff; border-radius: 3px; padding: 4px; color: #fff!important}.abs-tkn {float: right}.i-font {color: #fff; background: #4080ff; padding-left: 2px; padding-right: 2px}.ntt-tkn {margin-top: -15px}.url-ch-tkn {font-weight: 700}</style><br /><div class="chuyen-huong-tkn"><h5 class="title"><i aria-hidden="true" class="fa fa-info-circle"></i> Xác nhận chuyển hướng <img src="https://i.imgur.com/jxSjBoy.gif" /></h5><div class="note">Bạn vừa nhấp một liên kết không thuộc <b>Trọng Khanh Nguyễn Blog</b>. Sau khi xác nhận, bạn sẽ được truy cập đến <span class="url-ch-tkn"><script type="text/javascript">document.write(str.GetValue("url")); </script></span>. Nhấp xác nhận để tiếp tục:</div><div class="ntt-tkn"><form name="loading"><div class="abs-tkn" style="display: inline;"><script type="text/javascript">document.write("<input class=\"xac-nhan-tkn\" style=\"margin-right:5px;text-align:center\" type=\"button\" onclick=\"location.href='"+str.GetValue("url")+"'\""+" value=\"Truy cập liên kết\"");</script></div><a class="back-home-ch-tkn" href="https://www.blogger.com/"> Trở về trang chủ</a></form></div></div>
Thay dòng màu xanh thành tên blog bạn.
Vậy là xong rồi, nó thật đơn giản phải không nào ! Nhưng khi chỉnh các đường link hãy đọc kĩ hướng dẫn nhé !
Nếu không thành công, đừng ngần ngại bình luận phía dưới để nhận được sự hỗ trợ nhé!
Chúc các bạn thành công !

