A Place to Put the Content
In the source code of your Web page, at the location where you want the content to be inserted, type something like this:
filetwo.html, in our examples), it will be inserted into that
DIV and displayed on the Web page.
The value of the
ID in the
ID must be unique in the Web page source code. It doesn't matter what the value of the
ID is so long as it begins with a letter, is composed entirely of alphanumeric characters, and is unique.
DIVneed not be empty when it is first loaded. Here's an example:
Any content in the
DIV tags, provided the tag has a unique
ID value. Any HTML tag that can contain Web page content can be used instead. Examples are
When you retrieve content to be put into a content tag, it shouldn't contain HTML tags which conflict with the tag where it's being inserted. In other words, if the content is to be put into a
SPAN tag, then it shouldn't contain any
DIV tags don't belong in
SPAN tags. The resulting HTML would not validate.
However, the reverse of the above example is okay. Content to be put into a
DIV tag may contain
To see for yourself, manually paste the content that would be retrieved into the tag where it would be placed. If the resulting source code validates, it's okay. Otherwise, no. To elaborate, when I say "validate," I mean if the source code were scanned by HTML validating software, it would find no errors. It's possible to use source code that doesn't validate properly, but it's important to be aware that even if it works okay in one browser, it might totally misbehave in another.
/fileone.html and inserts it into the HTML tag with
Note that the URL in the above link is a relative URL. An absolute
Make another link. Use this one to retrieve content from URL
/filetwo.html. When you click on the second link, the content in the HTML tag with
id="AnIdentification" will change yet again. Every time you click one or the other of the links, the content changes to that which is retrieved by the latest click.
Change the value of function
ReplaceElementID()'s ID parameter to insert content into different a place, a different HTML content tag with a unique ID.
For example, software on your server to retrieve data records might be called with a link like this:
The output of
page.php will then be inserted into the HTML tag with