My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 272: Get element in an iframe
2 people starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Jul 2009


 
Reported by jeremie....@gmail.com, Jul 1, 2009
NyroModal 1.5.0

What steps will reproduce the problem?
1. Open a new modal with a link and a "_blank" parameter, in order to use
an iframe. I have a form in my iframe. I use it (reload the content of the
iframe).
2. When closing the modal, call to the callback "beforeHideContent" to get
elements in my iframe.
3. I use elts.contentWrapper to find an element, but the elements are
stopped at the iframe : see the following code :

var beforeHideContent = function(elts, settings, callback) {
    console.info(elts.contentWrapper.find("#nyroModalIframe #myID"));
    callback();
}

selector "#nyroModalIframe" return a jQuery object.
selector "#nyroModalIframe #myID" return an empty object ! What's wrong ?
Jul 1, 2009
#1 jeremie....@gmail.com
I found a solution : using the "contents()" jQuery function :

For my code :
var beforeHideContent = function(elts, settings, callback) {
   console.info(elts.contentWrapper.find("#nyroModalIframe").contents().find("#myID"));
   callback();
}

It works fine.

elts.contentWrapper.find("#nyroModalIframe").contents() return a jQuery object with
all the document in case of iframe.
Jul 9, 2009
Project Member #2 nyro...@gmail.com
sorry for the delay and thank you for sharing your solution!
Status: Invalid

Powered by Google Project Hosting