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';function fallbackCopy(text) {
var textarea = document.createElement('textarea');
textarea.value = text;
textarea.setAttribute('readonly', '');
textarea.style.position = 'fixed';
textarea.style.opacity = '0';
textarea.style.pointerEvents = 'none';
document.body.appendChild(textarea);
textarea.select();try {
document.execCommand('copy');
} finally {
document.body.removeChild(textarea);
}
}function copyText(text) {
if (navigator.clipboard && window.isSecureContext) {
return navigator.clipboard.writeText(text);
}return new Promise(function (resolve, reject) {
try {
fallbackCopy(text);
resolve();
} catch (error) {
reject(error);
}
});
}function openAffiliateUrl(url) {
window.open(url, '_blank', 'noopener,noreferrer');
}document.addEventListener('click', function (event) {
var button = event.target.closest('[data-code][data-url]');
if (!button) return;var code = button.getAttribute('data-code');
var url = button.getAttribute('data-url');
var original = button.textContent;/*
* 先同步開啟空白分頁,降低瀏覽器把延遲 window.open
* 判定為彈出式廣告的機率。
*/
var newTab = window.open('', '_blank');copyText(code)
.then(function () {
button.textContent = 'COPIED ✓';
button.classList.add('is-copied');if (newTab) {
newTab.opener = null;
newTab.location.href = url;
} else {
openAffiliateUrl(url);
}setTimeout(function () {
button.textContent = original;
button.classList.remove('is-copied');
}, 1200);
})
.catch(function () {
if (newTab) {
newTab.opener = null;
newTab.location.href = url;
} else {
openAffiliateUrl(url);
}
});
});
})();
(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);
}
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 被移除
}
});