0

I have an Apache Cordova Application that uses the AngularJS framework. A service is pulling in a list of JSON objects that contain 1 url each to populate a menu. Once the user selects one of the menu items the application grabs the url from the object and binds it into an iframe. I have all of this working however, with one of my urls the page is not displaying. Is there a way I can log the response of the iframe after it is loaded?

Here is a snippet from the partial.

 <div class="row header">
        <div class="col-lg-4 pull-left pharma_setting_icon1"></div>
        <div class="col-lg-4 pull-left text-center store_name_main_div"><strong>{{ label }}</strong></div>
        <div class="col-lg-4 pull-right nav-icon-header">
        </div>
    </div>
    </div>
    <div class="scroll-wrapper iframe-holder">
        <iframe data-ng-src="{{ currentUrl }}"></iframe>
    </div>

Is there an easy way to use javascript to log the response of this iframe if I assign it an id?

Josh Fischer
  • 439
  • 2
  • 15

1 Answers1

1

With some changes in answer on this url

You should declare a global variable in parent like :

<script> var myglobal; </script>

Then in your iframe html codes you can change that global variable by calling parent keyword , like :

<script>  parent.myglobal='something'; </script>
Community
  • 1
  • 1
Ali Esmaeili
  • 542
  • 1
  • 4
  • 14
  • I haven't actually verified it works yet since we did a work around, but since you are the only one who responded I gave it to you. Thanks for the info. – Josh Fischer Mar 25 '16 at 18:52