https://2p4c.tw/wp-includes/js/jquery/jquery.min.js
https://2p4c.tw/wp-includes/js/jquery/jquery-migrate.min.js
(function() {
if (window.location.pathname.startsWith('/en/')) {
var topBar = document.getElementById('p4c-top-bar');
if (topBar) topBar.style.display = 'none';
}
})();
(function(){
"use strict";var root = document.getElementById("kk26-nov");
if (!root || root.dataset.initialized) return;
root.dataset.initialized = "true";var defaultUrl = "https://www.kkday.com/zh-tw?cid=9516";function fallbackCopy(value) {
var el = document.createElement("textarea");
el.value = value;
el.setAttribute("readonly","");
el.style.position = "fixed";
el.style.left = "-9999px";
document.body.appendChild(el);
el.select();
var ok = document.execCommand("copy");
document.body.removeChild(el);
if (!ok) throw new Error("Copy failed");
}function copyCode(value) {
if (navigator.clipboard && window.isSecureContext) {
return navigator.clipboard.writeText(value);
}
fallbackCopy(value);
return Promise.resolve();
}root.addEventListener("click", function(event) {
var btn = event.target.closest("button[data-code]");
if (!btn || !root.contains(btn)) return;var code = btn.getAttribute("data-code");
var url = btn.getAttribute("data-url") || defaultUrl;
var original = btn.textContent;// 有指定導購網址的按鈕才開新分頁;
// 表格按鈕只複製,避免閱讀時反覆跳轉。
var redirect = btn.hasAttribute("data-url");
var tab = redirect ? window.open("about:blank","_blank") : null;if (tab) tab.opener = null;copyCode(code)
.then(function() {
btn.textContent = "已複製 ✓";
btn.classList.add("copied");
})
.catch(function() {
btn.textContent = "請手動複製:" + code;
})
.finally(function() {
if (redirect) {
if (tab) {
tab.location.replace(url);
} else {
window.location.assign(url);
}
}setTimeout(function() {
btn.textContent = original;
btn.classList.remove("copied");
}, 1800);
});
});
})();
(function () {
// FAQ Data
var faqs = [
{ q: 'KKday 折扣碼要在哪裡輸入?', a: '在 KKday 結帳頁面的付款資訊上方,點選「使用折扣碼」或「輸入優惠碼」欄位,填入代碼並套用即可。' },
{ q: '為什麼我的折扣碼顯示不適用?', a: '常見原因包括該碼已過期、商品非適用範圍(如機票、部分特價票券)、或您的帳號已曾使用過該次活動代碼。' },
{ q: '新戶折扣碼和舊戶可以用同一個嗎?', a: '通常不共用。新戶代碼(如 APP90)折扣力度較強,僅限首購;舊戶代碼則多為滿額折抵或指定商品促銷。' }
];var faqContainer = document.getElementById('kks-faq-render');
faqs.forEach(function (item) {
var el = document.createElement('div');
el.className = 'kks-faq-item';
el.innerHTML = '<button class="kks-faq-q">' + item.q + '<span class="kks-faq-icon">+</span></button>' +
'<div class="kks-faq-a"><div class="kks-faq-a-inner">' + item.a + '</div></div>';
el.querySelector('.kks-faq-q').onclick = function() { el.classList.toggle('open'); };
faqContainer.appendChild(el);
});// Related Data (Keeping existing structure)
var related = [
{ icon: '🇯🇵', title: '大阪勝尾寺攻略', desc: '門票、交通巴士完整整理', href: 'https://2p4c.tw/world/japan-travel/%E5%A4%A7%E9%98%AA%E6%99%AF%E9%BB%9E%E5%8B%9D%E5%B0%BE%E5%AF%BA/' },
{ icon: '🌊', title: '福岡糸島一日遊', desc: '最美海岸線與咖啡廳指南', href: 'https://2p4c.tw/world/itoshima-shi/' },
{ icon: '🚢', title: '越南下龍灣攻略', desc: '郵輪路線與天數建議', href: 'https://2p4c.tw/world/halongbay/' },
{ icon: '🏜️', title: '美國羚羊峽谷', desc: '訂票、拍照與防雷提醒', href: 'https://2p4c.tw/world/%e7%be%9a%e7%be%8a%e5%b3%bd%e8%b0%b7/' }
];var relatedContainer = document.getElementById('kks-related-render');
related.forEach(function (item) {
var a = document.createElement('a');
a.className = 'kks-related-card';
a.href = item.href;
a.innerHTML = '<span class="kks-related-icon">' + item.icon + '</span><div><span class="kks-related-title">' + item.title + '</span><p class="kks-related-desc">' + item.desc + '</p></div>';
relatedContainer.appendChild(a);
});
})();
document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );
document.addEventListener('DOMContentLoaded', function() {var links = document.querySelectorAll('link[rel="alternate"][hreflang]');
var targetUrl = null;
var targetText = null;var isEnglish = window.location.pathname.indexOf('/en/') !== -1;
var currentLang = isEnglish ? 'en' : 'zh-TW';links.forEach(function(link) {
var lang = link.getAttribute('hreflang');
var href = link.getAttribute('href');
if (!href || lang === 'x-default') return;if (currentLang === 'zh-TW' && lang === 'en') {
targetUrl = href;
targetText = 'EN';
} else if (currentLang === 'en' && (lang === 'zh-TW' || lang === 'zh')) {
targetUrl = href;
targetText = '中';
}
});if (!targetUrl) return;var btn = document.createElement('a');
btn.className = 'p4c-lang-float';
btn.href = targetUrl;
btn.title = currentLang === 'zh-TW' ? 'Read in English' : '閱讀中文版本';
btn.textContent = targetText;
btn.style.display = 'flex';document.body.appendChild(btn);
});
function genesisBlocksShare( url, title, w, h ){
var left = ( window.innerWidth / 2 )-( w / 2 );
var top = ( window.innerHeight / 2 )-( h / 2 );
return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=600, top='+top+', left='+left);
}
// Open share popup via data attributes; never reads executable context from the DOM.
document.addEventListener( 'click', function( e ) {
var el = e.target && e.target.closest( '[data-gb-share-url]' );
if ( ! el ) { return; }
e.preventDefault();
genesisBlocksShare( el.getAttribute( 'data-gb-share-url' ), el.getAttribute( 'data-gb-share-label' ) || '', '600', '600' );
} );
var ConverlyCustomData = {channelId: null};
const loadScriptsTimer=setTimeout(loadScripts,5*1000);const userInteractionEvents=['click', 'mousemove', 'keydown', 'touchstart', 'touchmove', 'wheel'];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})}
function loadScripts(){document.querySelectorAll("script[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}
var rtocScrollAnimation = {"rtocScrollAnimation":"on"};
var rtocBackButton = {"rtocBackButton":"off"};
var rtocBackDisplayPC = {"rtocBackDisplayPC":""};
var rtocOpenText = {"rtocOpenText":"OPEN"};
var rtocCloseText = {"rtocCloseText":"CLOSE"};
//# sourceURL=rtoc_js-js-extra
https://2p4c.tw/wp-content/plugins/rich-table-of-content/js/rtoc_common.js
https://2p4c.tw/wp-content/plugins/rich-table-of-content/js/rtoc_scroll.js
https://2p4c.tw/wp-content/plugins/rich-table-of-content/js/rtoc_highlight.js
https://2p4c.tw/wp-content/plugins/genesis-blocks/dist/assets/js/dismiss.js
https://2p4c.tw/wp-content/plugins/breeze/assets/js/js-front-end/breeze-lazy-load.min.js
document.addEventListener("DOMContentLoaded", function () {
if ( "function" !== typeof window.LazyLoad && "function" !== typeof LazyLoad ) {
return;
}var breezeLazyLoad = window.LazyLoad || LazyLoad;window.lazyLoadInstance = new breezeLazyLoad({
elements_selector: ".br-lazy",
data_src: "breeze",
data_srcset: "brsrcset",
data_sizes: "brsizes",
class_loaded: "br-loaded",
threshold: 300,
});
});
//# sourceURL=breeze-lazy-js-after
var csLocalize = {"siteSchemeMode":"light","siteSchemeToogle":""};
//# sourceURL=csco-scripts-js-extra
https://2p4c.tw/wp-content/themes/swyft/assets/js/scripts.js
https://2p4c.tw/wp-content/themes/swyft/assets/static/js/comment-reply.js
https://2p4c.tw/wp-content/plugins/akismet/_inc/akismet-frontend.js
window.addEventListener("DOMContentLoaded",(e=>{document.querySelectorAll('img[loading="lazy"]').forEach((e=>{e.getBoundingClientRect().top<=window.innerHeight&&(e.loading="eager")}))}));
const loadScriptsTimer=setTimeout(loadScripts,5*1000);const userInteractionEvents=["mouseover","keydown","touchstart","touchmove","wheel"];userInteractionEvents.forEach(function(event){window.addEventListener(event,triggerScriptLoader,{passive:!0})});function triggerScriptLoader(){loadScripts();clearTimeout(loadScriptsTimer);userInteractionEvents.forEach(function(event){window.removeEventListener(event,triggerScriptLoader,{passive:!0})})}function loadScripts(){document.querySelectorAll("script,iframe[data-type='lazy']").forEach(function(elem){elem.setAttribute("src",elem.getAttribute("data-src"))})}
document.addEventListener("DOMContentLoaded", function () {
const firstSlideImg = document.querySelector(
".cs-hero-type-1_item[data-swiper-slide-index='0'] img"
);if (firstSlideImg) {
firstSlideImg.loading = "eager"; // 讓它成為優先載入圖
firstSlideImg.decoding = "async";
firstSlideImg.removeAttribute("loading"); // 確保 lazy 被移除
}
});