Detect Browser - switch to iframe or url as page loads

D

dj

Hi,

Anyone have a snippet of code that will guide me as follows;

I want to use an iframe but if the browser does not support iframes I
want to simply replace the iframe HTML code with the URL which will be
in the iframe.

I'll probably detect the browser to make the switch.

I'm a beginner in javascript so any help is appreciated.

regards
DJ
 
L

Lasse Reichstein Nielsen

I want to use an iframe but if the browser does not support iframes I
want to simply replace the iframe HTML code with the URL which will be
in the iframe.

No scripting necessary, HTML can do that:

<iframe src="something.html"><a href="something.html">Something</a></iframe>

If a browsers doesn't know the iframe tag, it must ignore it. That
makes the anchor tag visible. If it knows the iframe tag, it knows to
ignore the content too.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top