यदि आप चाहते हैं कि आपका कोड सत्यापित करने के लिए आप जावास्क्रिप्ट के साथ ऐसा कर सकते हैं। जब मैं इस समस्या को कुछ महीने पहले here
var iframe = document.createElement("iframe");
iframe.src = "banner_728x90.gif";
iframe.width = "728";
iframe.height = "90";
iframe.frameBorder = "0";
iframe.scrolling = "no";
document.body.appendChild(iframe);
च आप अन्य पृष्ठ iframe में निर्बाध आप यह कर सकते हैं यदि आप कॉपी लोड और अपने पृष्ठ के सिर में इस कोड को पेस्ट करना चाहते था मैं सही जवाब मिल गया । मैंने इसे मुफ्त स्क्रिप्ट वाले साइट पर पाया। प्रदर्शन अधिकांश मामलों में अच्छा है
function getDocHeight(doc) {
doc = doc || document;
var body = doc.body, html = doc.documentElement;
var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
return height;
}
function setIframeHeight(id) {
var ifrm = document.getElementById(id);
var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;
ifrm.style.visibility = 'hidden';
ifrm.style.height = "10px"; // reset to minimal height in case going from longer to shorter doc
ifrm.style.height = getDocHeight(doc) + 10 + "px";
ifrm.style.visibility = 'visible';
}
फिर आप अपना आईफ्रेम एक आईडी दें और स्क्रिप्ट को लोड पर कॉल करें। इस तरह से।
var iframe = document.createElement("iframe");
iframe.setAttribute('id', "ifrm1");
iframe.setAttribute('src', 'http://www.hekcmviw.com/'); // change the URL
iframe.setAttribute('width', '100%');
iframe.setAttribute('height', '10');
iframe.setAttribute('frameBorder', '0');
iframe.setAttribute('scrolling', 'no');
iframe.setAttribute('onload' ,"setIframeHeight(this.id)");
document.body.appendChild(iframe);
स्टैक ओवरव्लो में टेक्स्ट क्षेत्र के नीचे एक शानदार पूर्वावलोकन क्षेत्र है जहां आप अपना प्रश्न दर्ज करते हैं। पोस्ट करने से पहले अगली बार फ़ॉर्मेटिंग को ठीक करने के लिए उस पूर्वावलोकन का उपयोग करें। – OregonGhost