473,805 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Include one html file in another

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
6 3428
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
Hywel <hy**********@h otmail.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
In article <40************ *************** *****@4ax.com>, me@privacy.net
says...
Hywel <hy**********@h otmail.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
Hywel <hy**********@h otmail.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
In article <k5************ *************** *****@4ax.com>, me@privacy.net
says...
Hywel <hy**********@h otmail.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
Hywel <hy**********@h otmail.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6415
by: Astra | last post by:
Hi All Could you please confirm whether it is possible to include an include file, which is on another site, but still on the same set of web servers. I want to upload a default paeg to a number of web sites for certain domains, but I would like the majority of the code for this page to be on 1 central site so that if I need to do an update of this page I only need to update it on one site.
0
1279
by: ym | last post by:
Hi, Has anybody done this before... The current html file has to 2 drop down boxes. Depending on the selection chosen, there is a predetermined html file to load. My new asp file will replace the current html that has the 2 drop down boxes and it has its own set of design and graphics. So depending on the selection chosen, instead of loading the predetermined html file, I need to grap a section of the contents in this predetermined...
3
11829
by: Brit | last post by:
Hello, I have been trying to include a js file from within another js file. I can get this to work for firefox, but not i.e. What I have is a.html ... <script language='JavaScript' src='b.js'></script><script>Function();</script> b.js .... function Function() {
6
2129
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file = ...\includes\StaffingHeaders.inc -->" </Script> <%=ClientName%> ****************************************************************************
11
2272
by: MBS | last post by:
I am playing around with some PHP code. I want to put in an include() function so I can include existing HTML code and output it to the browser. Lo and behold PHP does not support relative paths with the include() function! (How shortsighted can you get?) Is there any way at all to use relative paths with include()? Any hacks? If I use an absolute filepath, everything is fine. But I don't want to do that--I can't do that. I want...
3
1679
by: indessen | last post by:
Hi, got the following problem: I need to include an HTML file that sits on another server B in an HTML file that sits on server A, and I need to include this at a particular place in the file. The "include" command doesnt work obviously as it is server-side. In other words: say I have a webpage, at a particular place, for example halfway down, I want to include HTML that sits on another server.
11
26648
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
4
3382
by: Jon Slaughter | last post by:
I'm using eval to excute some mixed php and html code but I cannot debug it. I am essentially using filegetcontents to load up a php/html file and then inserting it into another php/html file and then using eval to execute the final product. If I were to use include and output buffering instead of filegetcontents would it allow be to debug the code? (I have to capture the include so it can be modified which is why I used...
6
4192
by: j.woodcock | last post by:
is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that reading the file using "Response.Write FSO.OpenTextFile(ppp, 1, False, False).readall" prints the file, and treating it like a html file. can anyone suggest another way of doing this?
1
2245
by: yemen2007 | last post by:
hi ever one. i have problem in my html file. i have header file , footer file, and index file. i want compile the header , and footer in the index file use include file put it is not work. this my code.so plz hellp me this inside the footer.html <a href="contact_info.html">Contact Us</a> <a href="copyright_info.html">Copyright &copy; 2000-2002</a> <a href="about_us.html">Tailspin Toys</a> this inside the header.html
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.