Let’s say I have an iframe page (iframe.html). Inside this page, I have a script
$(body) or $(document). Now I wanted to understand what does it represent ?
Does it refer to iframes body or the main page body ? If it represnts the main page, how do I make it refer to the iframe ?
$('body')anddocumentrefer to those of theiframe‘s own document.Within the encapsulating page, use this to access the
iframecontents with jQuery selectors.Within the
iframe,window.parentmay refer to the encapsulating page.