[HELP!] how to change HTML into an iFrame?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Si
    Such Fun!
    • Feb 2008
    • 13900

    #1

    [HELP!] how to change HTML into an iFrame?

    This may seem like a dumb fucking question but I can't figure out how to do it

    Example of what I need to do;

    Change this:
    Code:
    <a href="http://www.blahblah.com"><img src="http://www.blahblah.com/blah.jpg"></a>
    Into something like this:
    Code:
    <iframe src="http://www.blahblah.com/?????????" border="0" width="728" height="90"  name="whatever" scrolling="no" frameborder="0"></iframe>
    How do I do it?

    It's probably something simple i've overlooked but I tried a few combinations and all have failed so far.

    Any help would be greatly appreciated
  • Jakke PNG
    ex-TeenGodFather
    • Nov 2001
    • 20306

    #2
    You make a page that has your 'upper code' and nothing else.
    Then you iframe that page.

    Not sure why you'd want to do that though.
    ..and I'm off.

    Comment

    • mrwilson
      mrwilson 2.0
      • Jul 2007
      • 5122

      #3
      Or you can use a div and set the css to overflow: scroll; this way its all inside one page

      Comment

      • Si
        Such Fun!
        • Feb 2008
        • 13900

        #4
        Thanks guys

        I thought it would be something simple

        Comment

        • SmokeyTheBear
          ►SouthOfHeaven
          • Jun 2004
          • 28609

          #5
          heres a rather dirty way of doing it

          Code:
          <html>
          <body>
          <iframe id=adframe src="#" width=600 height=200></iframe>
          <button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
          <button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>
          
          <script type="text/javascript">
          var s1 = "<a href=http://gfy.com>gfy</a>";
          var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
          adframe.document.write("<div id=stuff></div>");
          </script>
          </body>
          </html>
          what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script
          hatisblack at yahoo.com

          Comment

          • SmokeyTheBear
            ►SouthOfHeaven
            • Jun 2004
            • 28609

            #6
            depending on what your doing withit you might want to set it up differently but this way you can keep some content in the iframe that stays and just change part of the page within the iframe
            hatisblack at yahoo.com

            Comment

            • seeandsee
              Check SIG!
              • Mar 2006
              • 50945

              #7
              is there posibility to tell frame what part of page to show exactly, not just margins
              BUY MY SIG - 50$/Year

              Contact here

              Comment

              • Si
                Such Fun!
                • Feb 2008
                • 13900

                #8
                Originally posted by SmokeyTheBear
                heres a rather dirty way of doing it

                Code:
                <html>
                <body>
                <iframe id=adframe src="#" width=600 height=200></iframe>
                <button onclick=adframe.document.getElementById('stuff').innerHTML=s1>Change html 1</button><br>
                <button onclick=adframe.document.getElementById('stuff').innerHTML=s2>Change html 2</button><br>
                
                <script type="text/javascript">
                var s1 = "<a href=http://gfy.com>gfy</a>";
                var s2 = "<a href=http://ytmnd.webspacemania.com/htyt/>htyt</a>";
                adframe.document.write("<div id=stuff></div>");
                </script>
                </body>
                </html>
                what you are doing is basically setting a blank iframe , adding a div called stuff to it, then injecting the html with script
                That seems a bit long winded. but I'll remember that for the future. might come in handy elsewhere

                Comment

                Working...