1

I want get the attribute 'src' of a iframe from other html.

I can get the attribute of a iframe in the same html but not from other html,

look my code:

/////////iframe attribute from the same html//////////

   var Mframe_src = $("#Mframe").attr('src');

   alert(Mframe_src);

//////////iframe attribute from other html////////////

var frame_Ads = $("#Mframe").contents();

var Ads_src = frame_Ads.find("#ads");

alert(Ads_src.attr('src')); /// the alert present me undefined
Deduplicator
  • 44,692
  • 7
  • 66
  • 118

1 Answers1

1

That's impossible, you could try to get the iframe content by ajax though and then do something with that.

$.get("my iframe page").success(data){
//do something
});