|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
when you say "pull" what do you mean???
------------------ gee......thanks! |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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?
|
|
#7
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Pull external html page into page Without Frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|