Get the iframe created in the future

Get the iframe created in the future

Hi for all,

I'd like to perform some procedures using the load event of an iframe (ifr-feature). However, the iframe will be created within another iframe (ifr1). The detail is that the iframe is created from a user action and in that sense it does not already exist. The only information I have is the ID of the iFrame. For that i'm using the 'on' to try to get the iframe created in the future, but this is not working.

  1. <iframe id="ifr1">
      ...
      <iframe id="ifr-feature"> -- created in the feature
      ...





  1. $('#ifr1').contents().find('iframe').attr(id).match(/ifr-feature/).on('load', function () {
      ...
    )}




Any suggestions?