0

I am loading in an iframe from RightMove and I want to remove certain aspects of it. I've tried CSS and jQuery but I think the onLoad is not working. Here is my code:

jQuery('#advanced_iframe_2').load(function() { 
    jQuery("#globalHeader").hide();
    console.log('Working status 1');
});

And I am trying this :

jQuery(document).ready(function() {
  jQuery('#advanced_iframe_2').ready(function() {
   console.log('Working status 2');
  });
});

Can anyone point me in the right direction please?

Cheers

bob
  • 33
  • 2
  • Not sure will read through. Cheers – bob May 31 '18 at 12:31
  • 1
    It is not possible to modify the contents of a third-party iframe. That link isn't a duplicate, as it describes how to trigger a function *in the parent window* when the iframe loads; you want to trigger a function in the iframe, which would require cooperation (at least CORS access) from the framed site. – Daniel Beck May 31 '18 at 12:33
  • Unless you can edit the other site (*RightMove*?) you can't detect when the iframe is fully loaded. In those cases you can try `window.onload` which is the last phase of page load. You can only access the ` – zer00ne May 31 '18 at 12:34
  • You cannot modify the content of a cross-domain iframe unless the third-party has explicitly allowed it, which is *extremely* unlikely for a public-facing website. – Rory McCrossan May 31 '18 at 12:35
  • Thanks to all who have commented. Ah bugger.. – bob May 31 '18 at 12:52

0 Answers0