1

I require to find the DOM element which is adding inside of a iframe, with the iframe added. for determine to find the element added, I am using this plugin

all i doing from chrome ext.

arrive.js body>iframe1>iframe.ssueContentIframe2>#SmartReportTabContent1>loopElements>link

like this:

document.arrive(".ssueContentIframe", function() {
    console.log('.ssueContentIframe arrived', this);//works

this.arrive('#SmartReportTabContent1', function(){
console.log('arrive 2');//not working
});
});

what is wrong here? any one help me please?

3gwebtrain
  • 14,640
  • 25
  • 121
  • 247

2 Answers2

2

To check for an element within an iframe you need to include the arrive.js library and your script that calls the arrive() function within the iframe.

Uzair Farooq
  • 2,402
  • 3
  • 24
  • 37
0

If you just want to detect whether iframe is loaded there's other solutions, but if you want to muck around in the iframe you have to keep in mind cross-domain policies.

Javascript has a Same-Origin policy in which javascript on the outer page cannot access the contentWindow or DOM (or global state) of the iframe page if it does not share the Same-Origin -- T. Stone

Seems to me arrive.js isn't the problem, it's trying to mess with an iframe.

Julix
  • 598
  • 1
  • 9
  • 20