trying to document.write() a SSI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Brant

    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="Javas cript" 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
  • Richard Formby

    #2
    Re: trying to document.write( ) a SSI


    "Greg Brant" <greg_brant@yah oo.co.uk> wrote in message
    news:b7fe000f.0 401290226.5ddef 2cb@posting.goo gle.com...[color=blue]
    > my script is
    >
    > document.write( "<!-- #include
    > virtual\"http://www.where-ever.com/whatevere.html\ " -->")
    >
    > but in the html (view source) i get
    >
    > ---------------------------------------------------
    > <script language="Javas cript" 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 "<!--".[/color]

    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.



    Comment

    • Greg Brant

      #3
      Re: trying to document.write( ) a SSI



      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!

      Comment

      • Richard Formby

        #4
        Re: trying to document.write( ) a SSI


        "Greg Brant" <greg_brant@yah oo.co.uk> wrote in message
        news:4018f7df$0 $70307$75868355 @news.frii.net. ..[color=blue]
        >
        >
        > any suggestions how can i do what im trying to achieve?[/color]

        What exactly are you trying to achieve?

        [color=blue]
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]

        Hmmm.


        Comment

        • kaeli

          #5
          Re: trying to document.write( ) a SSI

          In article <4018f7df$0$703 07$75868355@new s.frii.net>,
          greg_brant@yaho o.co.uk enlightened us with...[color=blue]
          >
          >
          > any suggestions how can i do what im trying to achieve?
          >[/color]

          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?



          Comment

          • Richard Cornford

            #6
            Re: trying to document.write( ) a SSI

            "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
            news:MPG.1a82cf 532f246efd989b9 0@nntp.lucent.c om...
            <snip>[color=blue]
            >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.[/color]

            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.


            Comment

            • kaeli

              #7
              Re: trying to document.write( ) a SSI

              In article <bvb7dl$hlh$1$8 300dec7@news.de mon.co.uk>,
              Richard@litotes .demon.co.uk enlightened us with...[color=blue]
              >
              > The greater flexibility of server-side scripting aside, I can't see a
              > difference between:-
              >[/color]
              <snip>

              Me neither actually.
              It's early. :)
              [color=blue]
              >
              > That is, if the point is to get the included HTML onto the page why not
              > include it in the HTML?
              >[/color]

              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.



              Comment

              • Greg Brant

                #8
                Re: trying to document.write( ) a SSI



                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!

                Comment

                • @SM

                  #9
                  Re: trying to document.write( ) a SSI



                  Greg Brant a ecrit :[color=blue]
                  >
                  > 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..[/color]

                  you certainly can do that with JavaScript.

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

                  to reach a specific page

                  js_read.html
                  <html>
                  <script type="text/javascript">
                  this.location.e scape();
                  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.e scape();
                  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:stephane OTER_MOImoriaux @wanadoo.fr
                  Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

                  *************** *************** *************** *************** **

                  Comment

                  Working...