问题
I have an iframe in my site and this iframe loads a page with jQuery. It seems that the jQuery is using the iframe dimensions as a reference instead of my actual document. For example, I used an iframe refering to this:
$.jGrowl(title + " has been used");
(jGrowl is a plugin that basically loads a notice on the upper right of the page)
When the notice shows, it is showing on the upper right of the iframe and not the actual document. Is there anyway to get the jQuery to refer to the actual site and not the iframe?
回答1:
document.parent points you to right direction
$(document.parent).jGlow(title + " has been used");
来源:https://stackoverflow.com/questions/6686166/iframe-jquery-scope-of-reference