-1

i'm working on project where there is a twenties of animation in generated pages. this pages are embedded into iframes of the index page. And i have to add elements to these pages (under the same project) via iframes contents. To simplify things i've tried first to change the iframe body background or add a simple tag to the iframe body. it works with firefox but not with chrome !

// works with firefox but not with chrome
$('#frameId').load( function(e) {
     alert('loading');
     $('#frameId').contents().find("body").append($("<h1>someThing</h1>"));
});
Alan Larimer
  • 589
  • 8
  • 24
nemrrached
  • 99
  • 7
  • Possible duplicate of [How can I access the DOM elements within an iFrame](https://stackoverflow.com/questions/24603580/how-can-i-access-the-dom-elements-within-an-iframe) – Alan Larimer Oct 21 '17 at 21:06

1 Answers1

1

Chrome has default security restrictions that don't allow you to access other windows from the hard disk even though they are technically the same origin. Here is your answer

ferhado
  • 2,363
  • 2
  • 12
  • 35