Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can Javascript Handle 2 Document nodes in Same Page?

    Hi,
    I have a web home page acts kind of like a Table of content/index for the rest of the pages in the website. I need to use javascript to get elements/nodes from different pages. It means that I need more than one document node.

    So is it possible to have more than 1 document nodes in one single page? If so, how can I do it?

    Many thanks.

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Yes..
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).

  • #3
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    if so, how? use iframe? any better way?

    Quote Originally Posted by hemebond
    Yes..

  • #4
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Using the xmlHttpRequest object.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).

  • #5
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    But how do I get the elements in php? If I use xmlhttprequest, it means that I have to use php to read my other pages and retrieve the elements. Is there functions in php to do that?

    Also, if I use iframe, I assign the url of my sub page into the iframe's src, then traverse the iframe's page. But the problem seems that the page isn't loaded yet and there is no document object of the iframe. So I can't traverse anything. How to get around that?

    Quote Originally Posted by hemebond
    Using the xmlHttpRequest object.
    Last edited by dealmaker; 08-13-2005 at 05:31 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •