|
Posted by Andy Dingley on 05/09/07 11:59
On 8 May, 18:35, Danny <daniel.max...@gmail.com> wrote:
> Hey everybody, I am a complete newbie with Javascript but was
> wondering if anybody could tell me how to load pages dynamicly within
> a div?
As a starter, don't load pages into a <div>, load them into an
<iframe>
There's a technique called AJAX that is increasingly popular. It loads
XML content into a JavaScript object (program code, not HTML) and then
lets you manipulate it. You could then save such content (or part of
it) into a <div>.
However AJAX only works with XML, not with HTML. The XmlHttpRequest
and similar objects only load well-formed XML (which might be XHTML)
and not non-XML HTML. If you're working with this, then you still
need to use an <iframe> (which can be invisible) as a dynamic load
container and then you can manipulate its contents. This could
include writing that content into a <div>.
Navigation:
[Reply to this message]
|