<script>
window.onload = function() {
const customContent = document.querySelector('#custom').innerHTML;
const checkIframeLoaded = setInterval(function() {
const iframe = document.getElementById('XXX');
if (iframe) {
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
const targetElement = iframeDoc.getElementById('XXX');
if (targetElement) {
targetElement.innerHTML += customContent;
clearInterval(checkIframeLoaded); // 停止计时器
} else {
console.error('#id element not found in iframe');
}
} else {
console.error('Iframe element not found');
}
}, 500); // 每 500 毫秒检查一次
};
</script>
10-23
1863