0

I am trying to have a link at the top of an iframe that users could use to save iframe src to their favorites. Something like what I have below... but my problem is that iframe is loaded dynamically, so I would have to have a way to catch whatever Iframe src is at that time. I am thinking that I need to do getElementById (somehow). Am I oversimplifying this? Is this possible?

<span style="cursor: hand; text-decoration: underline;" onclick="window.external.AddFavorite(location.href, document.title);">
Add to favorites</span>
Irma
  • 49
  • 7
  • So you're trying to dynamically inject said link **into** the ` – Obsidian Age Nov 14 '17 at 01:25
  • This answer might be helpful: https://stackoverflow.com/a/938195/463242 – ncardeli Nov 14 '17 at 01:52
  • Maybe I am not saying this right. I have an iframe on the page and lots of links on the parent page that open in that same iframe. I would like to be able to save to favorites whatever src URL happen to be at the time the user clicks "Save to favorites". All the recommendations are giving me the default src and not the src of the URL that happen to be displayed inside the iframe at that time. Most URLs are on the same domain but have some with different domains as well. Please help! – Irma Nov 14 '17 at 15:40

0 Answers0