|
-
Feb 7th, 2001, 12:23 AM
#1
Thread Starter
Addicted Member
Ok I have these two different webpages. One has about two lines of text (page y) on and the other is a full page with content (page x).
What I would like to do is be able to include page y on page x or for that matter include page y on any page in my website. I know you can do this in frontpage but its method is clummsy and doesn't work well. I am basically looking for a Javascipt that would let me include one page on another, anyone know how to write such a script?
Jeremy
-
Feb 7th, 2001, 07:41 AM
#2
Frenzied Member
Here's one way...
pageX.html
Code:
<HTML>
<body>
page X page x page X <BR>
page X page x page X <BR>
page X page x page X <BR>
page X page x page X <BR>
<SCRIPT SRC="pageY.js"><!--
//--></SCRIPT>
page X page x page X <BR>
page X page x page X <BR>
page X page x page X <BR>
page X page x page X <BR>
</body>
</HTML>
pageY.js
Code:
document.write('Hello. This is a line from pageY<BR>');
document.write('Second line from pageY<BR>');
-
Feb 7th, 2001, 02:50 PM
#3
As I have posted in the other thread - this web site may help for this problem and other java scripts you might want to use. The web site is : -
http://www.javascriptsource.com
Have fun!!!!!
-
Feb 7th, 2001, 09:20 PM
#4
PowerPoster
does it have to use javascript? You could do it very easy by using a server side include. But if it must be javascript, mark's way is the best.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 8th, 2001, 03:34 AM
#5
Frenzied Member
zippa Try it and see! 
rculver One thing that really annoys me is "have a look at this site there might be somthing there" sort of replies. EXACT links please!
I had a quick look at javascriptsource and I wasn't impressed. I got javascript errors and that was using IE5!!!!!!!
I use www.irt.org as a main source of reference.
Jeremy Martin as, sail3005 says, reading the page on the server side is the best (only) way to do it because you would then be able to replace line feeds with <BR>s and the like.
Is server-side scripting an option for you?
-
Feb 8th, 2001, 01:48 PM
#6
Thread Starter
Addicted Member
Yes server side scripting is certinaly an option but I not really done this so if someone could point me in the right direction that would be verry appreciated.
Jeremy
-
Feb 8th, 2001, 07:58 PM
#7
PowerPoster
Here is an example:
some common include types are .inc, .asp, .shtml.
included.inc:
Code:
put your page contents here
then put this in the page that you want the add the above page to:
Code:
<!--#include file="included.inc"-->
-or-
<!--#include virtual="included.inc"-->
file will look for the file in the directory that you have it in, or a directory below it.
virtual will start in the root directory.
hope this helps. If you need any more help let me know, because this is one are that i am actually good in!
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 8th, 2001, 08:55 PM
#8
New Member
Mark: Javascript has a 40 word limit or something of that sort inside "document.write" doesn't it?
-
Feb 9th, 2001, 03:35 AM
#9
Frenzied Member
zippa: I wasn't aware of a limit but you could use multiple document.write()s
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|