Connecting Tech Pros Worldwide Help | Site Map

Get source code of a page from another page

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 26th, 2008, 11:49 AM
Newbie
 
Join Date: Aug 2008
Age: 21
Posts: 14
Default 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
Reply
  #2  
Old August 26th, 2008, 11:59 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 32
Posts: 2,209
Default

I guess, you have to use AJAX.
Expand|Select|Wrap|Line Numbers
  1. // invoke XmlHttpRequest object
  2. XMLhttpRequest.open("POST", "page2.html", true); // this could be the request
  3. // further AJAX code coming here
hope that helps a bit
Reply
  #3  
Old August 26th, 2008, 04:37 PM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 37
Posts: 3,780
Default

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
Reply
  #4  
Old August 27th, 2008, 01:00 AM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 898
Default

Moving to JavaScript Forum
Reply
  #5  
Old August 27th, 2008, 10:00 AM
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Age: 37
Posts: 3,780
Default

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
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.