Search code examples
jqueryhtmliframeframejgrowl

iframe jQuery scope of reference


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?


Solution

  • document.parent points you to right direction

    $(document.parent).jGlow(title + " has been used");