RotoGuru Computer Forum

View the Forum Registry

XML Get RSS Feed for this thread


Self-edit this thread


0 Subject: Consolidating pages using JavaScript

Posted by: Guru
- [330592710] Sat, Jun 20, 2009, 12:24

I've fiddled with this briefly, but haven't been able to solve it. Maybe it can't be done.

Here's a simple example:

I have three html pages. They are:
http://rotoguru1.com/base/jscript/test/page_1.html
http://rotoguru1.com/base/jscript/test/page_2.html
http://rotoguru1.com/base/jscript/test/page_3.html


I want to use Javascript to read in the pages, and consolidate the bodies of the three pages. The result would be a single html page with displays the output of all three pages.

This consolidating page (with the Javascript code) would not be in the same domain. Typically, it would reside on my local hard drive, but would need to access pages from web sites. So there may be a domain-crossing security issue. All of the underlying pages (to be combined) would be from the same domain, typically - but that probably doesn't matter.

Can this be done? I'm thinking that I could create three frames and read each page into one of the frames. Then, I could have a 4th frame which would display the combination page. But perhaps there is another way to do it.

In this example, the resulting page would presumably say "This is Page 1This is Page 2This is Page 3"
1WiddleAvi
      Sustainer
      ID: 361032112
      Sat, Jun 20, 2009, 13:22
I was trying to do something just like this and my book on asp shows how it can be done using asp. I tried but got errors doing it. The asp commands are Server.Execute and Server.Transfer

So for example you should be able to make one page that goes like this
Server.Execute "page1.html"
Server.Execute "page2.html"
Server.Execute "page3.html"

I ended up not needing this to do what I needed so I never troubleshot why I was getting errors running this command.
2youngroman
      Donor
      ID: 02934823
      Sat, Jun 20, 2009, 16:54
as long as the 3 pages are hosted on the same page as the javascript you want to write, then it is possible. otherwise it is not possible because of the Same origin Policy.

since you want to run it from your local machine it will not be possible.

simple question: why javascript? it is one of the worst programming languages out there.
3Guru
      ID: 330592710
      Sat, Jun 20, 2009, 19:16
Because I know it?
RotoGuru Computer Forum

View the Forum Registry

XML Get RSS Feed for this thread


Self-edit this thread




Post a reply to this message: (But first, how about checking out this sponsor?)

Name:
Email:
Message:
Click here to create and insert a link
Click here to insert a block of hidden (spoiler) text
Ignore line feeds? no (typical)   yes (for HTML table input)


Viewing statistics for this thread
Period# Views# Users
Last hour11
Last 24 hours11
Last 7 days54
Last 30 days119
Since Mar 1, 200731991170