1

Everybody knows, that it's possible to put a simple text inside iframe if it does not supported by browser. But is there any way to put a link inside it?

Like

<iframe src="#">
  Oops! Looks like your browser doesn't support iframe, try <a href="#">this</a> 
</iframe>

Maybe create some check using jquery or js if iframe supported or not? Anything? I tried to find any information about it in Internet but the result is nothing useful.

Claire
  • 91
  • 1
  • 12
  • You could try the `alt` attribute. ``, for images this is the go-to when your image failed loading – FllnAngl Jan 29 '20 at 08:22
  • iframes can host entire HTML documents, so including any links. Basically all browsers not opera mini support this. So I do not understand the issue. – Shilly Jan 29 '20 at 08:32

2 Answers2

0

You can handle it by using javascript easily. If your browser doesn't support iframe you can run your scripts inside an iframe and inside scripts you can do your code conditionality according to your need.

<iframe src="#">
  <script type="text/javascript">var is_supported= false;</script>
</iframe>
Sourav Singh
  • 878
  • 1
  • 8
  • 14
0

I'm not completely sure whether you want the entire iframe to link to somewhere else, or you just want to put a regular link inside the frame. I'll assume the second because I can't imagine why you'd want the first. Just use <iframe>, not <iframe src="#">. You can put links between <iframe> and </iframe> just like you would in any HTML.

codi6
  • 516
  • 1
  • 3
  • 18
  • I want to load src in iframe and if – Claire Jan 29 '20 at 12:29