How to load first.html into a certain

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Assume I have a HTML web page with a pre-defined <div> ...</div> area.

When the users clicks now on a certain link on this web page (outside or inside
this "div" area)
then the content of a file say "first.html" (currently still on the server)
should be loaded
and filled into the existing <div>...</div> area in the current Web page and

How can I do this in detail?


Re: How to load first.html into a certain
area? (Patricia Mindanao) writes:

Quoted text here. Click to load it

You can't do this without using some sort of server-side support.
That probably makes it off-topic here but I am not sure where this
sort of question belongs.

First, if you succeed (and it can be done) you will run into other
problems since a full HTML page is not permitted inside a DIV (see the
other recent thread on that topic).  It is best if the "injected"
material is a fragment -- specifically only those things that are
valid inside a DIV.

Second, you need to use some form of server-side include, together
with some mechanism that identifies what page is to be inserted (if it
always "first.html" then I would just have two static pages one with
an one with out the included text).

You could specify the page in the URL like this:

  <a href="outline.html?page=first.html">

whilst inside the <div>...</div> one could have a small piece of PHP
that includes the specified file (usually after checking the value to
prevent malicious uses).

Quoted text here. Click to load it

I'll leave it at the level of detail in case you were hoping for an
HTML-only solution.


Re: How to load first.html into a certain

Quoted text here. Click to load it


(There are special offers for posts to alt.html (it having gone very
quiet due to a few funerals).

For one week only. There are prizes, chances to win overseas holidays,
free code, free lots of things...



Site Timeline