Detect Browser - switch to iframe or url as page loads

Discussion in 'Javascript' started by dj, Apr 29, 2004.

  1. dj

    dj Guest

    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
     
    dj, Apr 29, 2004
    #1
    1. Advertising

  2. (dj) writes:

    > 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
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Apr 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Kotuby
    Replies:
    5
    Views:
    6,587
    John Kotuby
    Jun 24, 2008
  2. Robert Oschler
    Replies:
    4
    Views:
    261
    Csaba2000
    Aug 26, 2003
  3. Daedalous
    Replies:
    3
    Views:
    829
    Daedalous
    Jan 16, 2004
  4. yoko

    Dragable iFRAME LOADS URL INTO IT

    yoko, Mar 2, 2007, in forum: Javascript
    Replies:
    1
    Views:
    105
    Danny
    Mar 3, 2007
  5. ofir
    Replies:
    2
    Views:
    182
Loading...

Share This Page