#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Lincoln, NE US
    Posts
    2
    Rep Power
    0
    Okay, here is the question. This may be simple, or maybe not. I am trying to pull an external page (or cgi call, etc...) into an html page. The trouble I'm having, is that I do not want to use Frames, am not sure about using javascript, and have learned a little about using iFrames (or floating frames). Please advise.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    athens,greece
    Posts
    2
    Rep Power
    0
    when you say "pull" what do you mean???

    ------------------
    gee......thanks!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Lincoln, NE US
    Posts
    2
    Rep Power
    0
    When I say 'pull', I want to set it up like a Server Side Include (SSI), but obviously the file to include does not reside on the native server so SSI won't work.
  6. #4
  7. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    As I see it, you have a couple of choices: one is to use PHP, if your server can or will support it. The PHP include() function can act like SSI but bring in any URL. That is your simplest way of doing this, but it requires server-side code (a very small amount)

    Another choice works only for Netscape 4+ : the <LAYER> or <ILAYER> tag lets you specify an external source.

    For Internet Explorer, you might use the <IFRAME> tag which can essentially do the same thing.

    To work for both browsers, just set up a browser checking script and you're done.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    SPAIN
    Posts
    47
    Rep Power
    15
    Try to put this where you want the frame:
    <body>
    ......

    <script language='javascript'>
    var IE4=(document.all) ? 1 : 0;
    var NN4=(document.layers) ? 1 : 0;
    if (IE4) {
    var theSource='<iframe id="Floating" src="http://www.floating.com/float.htm" width=300 height=100></iframe>'
    document.write(theSource)
    } else if (NN4) {
    var theSource='<layer id=Floating src="http://www.floating.com/float.htm" width=300 height=100></layer>'
    document.write(theSource)
    }
    </script>


    ....
    </body>

    Change width, height and URL according to your needs. It works better in IE that in Netscape, but the result is similar
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    3
    Rep Power
    0
    Doesn't cross-site scripting security prevent you from accessing the content of the IFRAME or ILAYER through scripting, if the SRC is from another hostname?

  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    5
    Rep Power
    0
    All of these approaches assume you want to include dynamic content. If you're just trying to avoid cut-and-pasting navigation links or something along those lines, you can use a preprocessor to include the chunks of text into your documents statically. Dozens of utilities to accomplish this are available on FreshMeat and other places.

Similar Threads

  1. Replies: 0
    Last Post: February 8th, 2004, 11:11 PM
  2. Trouble inserting 2 scripts into html page
    By gundamcata in forum HTML Programming
    Replies: 0
    Last Post: October 2nd, 2003, 11:35 AM
  3. displaying html code on PHP generated page
    By safas in forum PHP Development
    Replies: 7
    Last Post: September 18th, 2003, 03:54 PM
  4. Pull variable in Flash SWF from HTML page
    By basher in forum Flash Help
    Replies: 0
    Last Post: June 8th, 2003, 06:56 PM
  5. send email as html page
    By Aaron77 in forum PHP Development
    Replies: 7
    Last Post: July 17th, 2002, 12:32 PM

IMN logo majestic logo threadwatch logo seochat tools logo