Include one html file in another

S

Spartanicus

For a non essential enhancement of one of my pages I'd like to include a
remote html file via javascript (server side is not available to me).

The "include" method that I'm familiar with:

<script src="include.js" type="text/javascript"></script>

with include.js containing:

document.write("<table>")
document.write("<tr>")
[...]

wouldn't work because it's a remote file. Is there a way to include a
remote file?
 
H

Hywel

For a non essential enhancement of one of my pages I'd like to include a
remote html file via javascript (server side is not available to me).

The "include" method that I'm familiar with:

<script src="include.js" type="text/javascript"></script>

with include.js containing:

document.write("<table>")
document.write("<tr>")
[...]

wouldn't work because it's a remote file. Is there a way to include a
remote file?

<script src="http://otherserver.com/include.js" type="text/javascript">
</script>
 
S

Spartanicus

Hywel said:
So why did you give an example of a JAVASCRIPT file that WRITES out
HTML?

To prevent being pointed out how to do that, it would have been useless
as the question specifically pertained to including a non local file.

Different thing completely, iframe/object opens a new viewport, included
html is part of the original document.
 
H

Hywel

To prevent being pointed out how to do that, it would have been useless
as the question specifically pertained to including a non local file.


Different thing completely, iframe/object opens a new viewport, included
html is part of the original document.

How about using JavaScript to get the remote page into an XML object,
then use an almost empty XSL to display the HTML?
 
S

Spartanicus

Hywel said:
How about using JavaScript to get the remote page into an XML object,
then use an almost empty XSL to display the HTML?

Sounds intriguing, care to expand?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top