angularjs - IE 10 iframe not rendering -


this in angular app believe error lies solely in ie relates iframe , src attribute. renders fine in chrome. large app it's hard silo error in jsfiddle. here pertinent pieces.

the html/angular markdown:

  <div ng-repeat="form in formstoprint">      <h5>{{ form.formname }} - {{ form.pagestatus }}</h5>      <iframe ng-if="form.formid != '9' && form.formid != '10'"            ng-src="{{ form.pagesrcurl }}"            print-iframe seamless="seamless"></iframe>       <div ng-if="form.formid == '9'" ng-repeat="srp in srpstoprint">           <h5>{{ srp.srpcode }} - {{ srp.pagestatus }}</h5>           <iframe ng-src="{{ srp.pagesrcurl }}"                     print-iframe seamless="seamless"></iframe>       </div>       <div ng-if="form.formid == '10'" ng-repeat="srp in localpackagestoprint">           <h5>{{ srp.srpcode }} - {{ srp.pagestatus }}</h5>           <iframe ng-src="{{ srp.pagesrcurl }}"                     print-iframe seamless="seamless"></iframe>       </div>     </div> 

the angular print-iframe directive:

  .directive("printiframe", function() {     return {         link: function(scope, element, attr) {             element.on("load", function() {                 var self = this,                     timeout = 8000;                 if (self.src.indexof("#/forms/8") !== -1                     || self.src.indexof("#/forms/5") !== -1                     || self.src.indexof("#/forms/36") !== -1                     || self.src.indexof("#/forms/9") !== -1                     || self.src.indexof("#/forms/10") !== -1                     || self.src.indexof("#/forms/19") !== -1                     || self.src.indexof("#/forms/37") !== -1                     || self.src.indexof("#/forms/38") !== -1) {                     timeout = 8000;                 }                  settimeout(function() {                     $(element).contents().find("div.navbar").hide();                     $(element).contents().find("div.binder-menu").hide();                       $(element).contents().find("div.commonbuttonbarcontainer").hide();                     $(element).contents().find("textarea.notes").closest("fieldset").hide();                     $(".formcontainer.print").height("100%");                     $(".formcontainer.print").width("100%");                      var height = $(element).contents().outerheight();                     var width = $(element).contents().outerwidth();                      if (height !== 0) {                         $(element).height(height + 100);                         $(element).width(width + 100);                     }                      $(element).contents().find(".formcontainer").css({ "margin-left": "25px" });                      $(element).show();                      scope.showprintwindow();                     console.dir(scope);                 }, timeout);             });         }       }   })       

i can't inspect pagesrcurl property in console assume correct because working in chrome. doctype declared properly.

the other stackoverflow questions i've found not address issue.

iframes , angular produce hickups. problem found can described:

if have got iframe somewhere , use angular example set source, browser start grabbing src immediatly after iframe added dom.

this leads problems, not in ie. solution have found in our project add specialized lazyiframe directive add iframe dom necessary attributes evaluated (and not undefined) more.

in case, problem related ng-src might lead following:

  • iframe added dom no src attribute
  • ie registers iframe , grabs source
  • ie fails iframe , stops
  • src changed iframe not re-loaded due ie bug

if need crafting lazyiframe directive can provide further details.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -