By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

Include one html file in another

P: n/a
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?

--
Spartanicus
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
In article <t6********************************@4ax.com>, me@privacy.net
says...
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>

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 20 '05 #2

P: n/a
Hywel <hy**********@hotmail.com> wrote:
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).


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


HTML file

--
Spartanicus
Jul 20 '05 #3

P: n/a
In article <40********************************@4ax.com>, me@privacy.net
says...
Hywel <hy**********@hotmail.com> wrote:
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).


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


HTML file


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

<iframe> - bad.

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 20 '05 #4

P: n/a
Hywel <hy**********@hotmail.com> wrote:
>> 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).
>
><script src="http://otherserver.com/include.js" type="text/javascript">
></script>
HTML file


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.
<iframe>


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

--
Spartanicus
Jul 20 '05 #5

P: n/a
In article <k5********************************@4ax.com>, me@privacy.net
says...
Hywel <hy**********@hotmail.com> wrote:
>> 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).
>
><script src="http://otherserver.com/include.js" type="text/javascript">
></script>

HTML file


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.
<iframe>


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?

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 20 '05 #6

P: n/a
Hywel <hy**********@hotmail.com> wrote:
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?


Sounds intriguing, care to expand?

--
Spartanicus
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.