473,473 Members | 4,297 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

trying to document.write() a SSI

my script is

document.write("<!-- #include
virtual\"http://www.where-ever.com/whatevere.html\" -->")

but in the html (view source) i get

---------------------------------------------------
<script language="Javascript" type="text/Javascript">
document.write("\
-----------------------------------------------------
and thats the end of the document..

i also have some more document.write()'s above this in the same script
tag and these are not executed.. im guessing because it doesent get to
the </script> tag??

also im guessing that the reason its stopping is because its
encountering the html comment sequence "<!--".

so how do i write this safley?

cheers

Greg
Jul 20 '05 #1
8 2504

"Greg Brant" <gr********@yahoo.co.uk> wrote in message
news:b7**************************@posting.google.c om...
my script is

document.write("<!-- #include
virtual\"http://www.where-ever.com/whatevere.html\" -->")

but in the html (view source) i get

---------------------------------------------------
<script language="Javascript" type="text/Javascript">
document.write("\
-----------------------------------------------------
and thats the end of the document..

i also have some more document.write()'s above this in the same script
tag and these are not executed.. im guessing because it doesent get to
the </script> tag??

also im guessing that the reason its stopping is because its
encountering the html comment sequence "<!--".


It doesn't matter. Even if you got the script to work it wouldn't work. SSI
is done server side. That is why it is called Server Side include.

By the time your script gets to execute you are client side, no further
access to the server.

Jul 20 '05 #2


any suggestions how can i do what im trying to achieve?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

"Greg Brant" <gr********@yahoo.co.uk> wrote in message
news:40***********************@news.frii.net...


any suggestions how can i do what im trying to achieve?
What exactly are you trying to achieve?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Hmmm.
Jul 20 '05 #4
In article <40***********************@news.frii.net>,
gr********@yahoo.co.uk enlightened us with...


any suggestions how can i do what im trying to achieve?


Assuming you're trying to include the content of one page within
another...
Use an IFRAME if you have no server-side language available (aside from
SSI).
If you have ASP or JSP, they can include pages in the output. I'm pretty
sure Perl can, too.

If you're trying to include pages only if some condition is true, and
that condition is determined on the client, you'll need javascript and
an IFRAME, as far as I know.

I'm out of ideas after that. :)

--
--
~kaeli~
If it's tourist season, why can't we shoot them?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
<snip>
Assuming you're trying to include the content of one page
within another...
Use an IFRAME if you have no server-side language available
(aside from SSI).
If you have ASP or JSP, they can include pages in the output.
I'm pretty sure Perl can, too.

If you're trying to include pages only if some condition is
true, and that condition is determined on the client, you'll
need javascript and an IFRAME, as far as I know.


The greater flexibility of server-side scripting aside, I can't see a
difference between:-

< some HTML >
<script type="text/javascript">
document.write("<!-- [SSI inserted HTML] -->");
document.write("something else");
</script>
< some more HTML>

- and:-

< some HTML >
<!-- [SSI inserted HTML] -->
<script type="text/javascript">
document.write("something else");
</script>
< some more HTML>

- Except that the latter is not JavaScript dependent and avoids having
to worry about the appropriateness of the characters within the include
in the context of a JavaScript string.

That is, if the point is to get the included HTML onto the page why not
include it in the HTML?

Richard.
Jul 20 '05 #6
In article <bv*******************@news.demon.co.uk>,
Ri*****@litotes.demon.co.uk enlightened us with...

The greater flexibility of server-side scripting aside, I can't see a
difference between:-
<snip>

Me neither actually.
It's early. :)

That is, if the point is to get the included HTML onto the page why not
include it in the HTML?


I think the OP wanted the html included only if some condition were
satisfied. It was unclear if the condition was decided on the client or
on the server. Actually, the whole question was unclear. *heh*

--
--
~kaeli~
A plateau is a high form of flattery.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #7


sorry fo being unclear.

The idea is that if a user has filled in a for then a page is included,
that page will take a variable posted from the form as an argument..

so.

the page to be included needs to process the variables and then be
included..

but i see that (obviously) SSI is server side..

I do have access to PHP so i am going to do it this way.. i was trying
to do it without php as a collegue is not proficient with the language

thanks for your response, somtimes the obvious is too obvious
cheers

Greg

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #8
@SM


Greg Brant a ecrit :

sorry fo being unclear.

The idea is that if a user has filled in a for then a page is included,
that page will take a variable posted from the form as an argument..


you certainly can do that with JavaScript.

The form
<html>
<form action="js_read.html">
Give your Name :
<input type=text name="MyArgument">
<input type=submit value="GO">
</fomr></html>

to reach a specific page

js_read.html
<html>
<script type="text/javascript">
this.location.escape();
if(MyArgument!='') self.location='trucmuche/'+MyArgument+'.htm';
</script>
Sorry JavaScript error
</html>

to write in a page

js_read.html
<html>
<script type="text/javascript">
this.location.escape();
function dc(txt) { document.write(txt);}
if(MyArgument!='') trucmuche ='<h2>Hello '+MyArgument+'</h2>';
else trucmuche ='';
</script>
<body>
blabla
<script type="text/javascript">
dc(trucmuche);
</script>
re blah blah
</body>
</html>

and/or use ssi same way
--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>");...
3
by: Catherine Lynn Smith | last post by:
I am creating a webpage with dhtml <DIV> layers and I want a link on one layer to modify the content on another but I seem to keep running into errors. Basically I create a layer in the middle...
3
by: Ike | last post by:
Can anyone discern why the following code writes the document.write() lines literally? That is, a line like document.write('<CENTER>') should write <CENTER> but instead writes the entire ...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
2
by: charliefortune | last post by:
I have succesfully made rollover images appear in a table cell, but I cannot seem to make the caption appear in a seperate cell underneath. This is how I attempted it .. <script...
1
by: sluster | last post by:
I'm looking to create a search box that creates different kinds of searches based on a radio button selection. The first stage of this process for me is setting it up so clicking on different radio...
1
by: colleen1980 | last post by:
Hi: I am trying to pull all the values from the listbox. But the ASP code shows only the last record. Needs help HTML <html> <head>
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.