Loading external HTML into a DIV

liunx

Guest
Hi there,<br />
<br />
1. How do I load an external HTML file into a DIV without JavaScript?<br />
<br />
2. How do I load an external HTML file into a DIV from another DIV without using JavaScript?<br />
<br />
2. How do I preload these to be loaded HTML files without using JavaScript?<br />
<br />
Cheers, Jochem :cool:<!--content-->Server-side<!--content-->Um... not entirely sure what you want but:<br />
<br />
1. You can't.<br />
<br />
2. You can't.<br />
<br />
3. You can't.<br />
<br />
However... you can use Server Side Includes to place chunks of HTML on a page. SSI must be enabled on your web server and you need to use the .shtm file extension for HTML pages that will use SSI. Then, in your HTML document (whose file extension is .shtm):<br />
<br />
<!-- #include file="url/to/text/file.txt" --><br />
<br />
If you want to pass variables to a CGI program or PHP script, use:<br />
<br />
<!-- #include virtual="url/to/serverside/script.php?variable=value" --><br />
<br />
<br />
Place those SSI tags inside the HTML tags that you want to contain the included HTML. Using the #include file="", you can include any text-based file: .html, .htm, .txt, .php, etc. Just make sure the text is written in HTML.<br />
<br />
SSI all happens before the HTML file gets delivered to the end user.<!--content-->Hmm... sounds like something I cannot manage from my home desk. I guess I'll stick to using framesets. Or am I misunderstanding something here?<br />
<br />
Cheers, Jochem :cool:<!--content-->You can use SSI's from your home desk as long as Server Side Includes are enabled on the web server you are working on.<br />
<br />
If you actually want to preview the site on your computer Download <!--more--> the Apache web server software and get it running. It's not too difficult and doesn't require the Unix OS. Once you've got the web server software running, you should be able to enable SSI in the httpd.conf file (I believe).<br />
<br />
Then place all your site's documents in the server folder that allows public access. Visit the "web site" on your computer at <!-- m --><a class="postlink" href="http://127.0.0.0">http://127.0.0.0</a><!-- m -->. This IP address is a reserved address that ALL computers use to refer to themselves. Going to that IP will cause the web server software to serve you an HTML page just as if it were a request from a remote computer across the Internet.<br />
<br />
If you can't do this, just design the pages and load them on the web server. View them via the Internet.<!--content-->Actually quite interesting, this SSI thing. I never heard of it. I guess I'll start reading about it. Thanks for the advise Greg!<br />
<br />
Cheers, Jochem :cool:<!--content-->
 
Back
Top