Get source code of a page from another page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • readnlearn
    New Member
    • Aug 2008
    • 15

    Get source code of a page from another page

    hii evry one

    I am having two page (page1.html and page2.html)

    Is it possible to get the whole source code of page2.html from page1.html
    (throu javascript)

    For example:

    on click event - I need to fetch whole content of the page2.html

    Please suggestion me if its possible
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I guess, you have to use AJAX.
    [CODE=javascript]// invoke XmlHttpRequest object
    XMLhttpRequest. open("POST", "page2.html ", true); // this could be the request
    // further AJAX code coming here[/CODE]
    hope that helps a bit

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      please post javascript-related questions in the javascript-forum ... hopefully a mod of the HTML-forum will move it there so you will get more responses when you ask in the appropriate forum ...

      kind regards
      MOD

      Comment

      • eWish
        Recognized Expert Contributor
        • Jul 2007
        • 973

        #4
        Moving to JavaScript Forum

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5390

          #5
          as Dormilich suggested you may use an AJAX-call for such a purpose. post back with something you have tried and/or in case you have any problems with that issue ...

          kind regards

          Comment

          Working...