SSI alternative

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Babba

    SSI alternative

    hi all,

    my ISP doesnt support SSI and therefor i try to javascript to get the
    same think done. the function i am interested in is ssi include virtual
    and after some searching i found many times the same anser; use:

    <!--
    document.write( " your HTML here ");
    // -->

    now the problem is that it only works when all HTML is put in 1 line !
    and this line cannot be longer than about 255 characters.

    i am working on a winXP machine and have tried to use a unix-like-editor
    (breakline thing) but still the same thing.

    question: do i do something wrong or how to get it working ??

    many thanks for helpful replies,

    martin
  • McKirahan

    #2
    Re: SSI alternative

    "Ali Babba" <AliBabba@40Ban dits.com> wrote in message
    news:cv57f3$91f $1@news.hispeed .ch...[color=blue]
    > hi all,
    >
    > my ISP doesnt support SSI and therefor i try to javascript to get the
    > same think done. the function i am interested in is ssi include virtual
    > and after some searching i found many times the same anser; use:
    >
    > <!--
    > document.write( " your HTML here ");
    > // -->
    >
    > now the problem is that it only works when all HTML is put in 1 line !
    > and this line cannot be longer than about 255 characters.
    >
    > i am working on a winXP machine and have tried to use a unix-like-editor
    > (breakline thing) but still the same thing.
    >
    > question: do i do something wrong or how to get it working ??
    >
    > many thanks for helpful replies,
    >
    > martin[/color]

    First omit "<!--" and "-->" as they're obsolete then change

    document.write( " your HTML here ");

    to:

    document.write( " your");
    document.write( "<br>HTML") ;
    document.write( "<br>here ");

    or:

    var html = [
    "your",
    "HTML",
    "here"];
    document.write( html.join("<br> "));


    Comment

    • David Dorward

      #3
      Re: SSI alternative

      Ali Babba wrote:
      [color=blue]
      > my ISP doesnt support SSI and therefor i try to javascript to get the
      > same think done.[/color]

      Stop! Backpedel!

      Including content using JavaScript is usually not a good idea. It will be
      invisible for the not-insignificant proportion of the world which does not
      have JS available and enabled (including GoogleBot).

      You can achieve the effects of SSIs using an HTML preprocessor as described
      at http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another

      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
      Home is where the ~/.bashrc is

      Comment

      • Ali Babba

        #4
        Re: SSI alternative

        McKirahan wrote:
        [color=blue]
        > "Ali Babba" <AliBabba@40Ban dits.com> wrote in message
        > news:cv57f3$91f $1@news.hispeed .ch...
        >[color=green]
        >>hi all,
        >>
        >>my ISP doesnt support SSI and therefor i try to javascript to get the
        >>same think done. the function i am interested in is ssi include virtual
        >>and after some searching i found many times the same anser; use:
        >>
        >><!--
        >>document.writ e(" your HTML here ");
        >>// -->
        >>
        >>now the problem is that it only works when all HTML is put in 1 line !
        >>and this line cannot be longer than about 255 characters.
        >>
        >>i am working on a winXP machine and have tried to use a unix-like-editor
        >>(breakline thing) but still the same thing.
        >>
        >>question: do i do something wrong or how to get it working ??
        >>
        >>many thanks for helpful replies,
        >>
        >>martin[/color]
        >
        >
        > First omit "<!--" and "-->" as they're obsolete then change
        >
        > document.write( " your HTML here ");
        >
        > to:
        >
        > document.write( " your");
        > document.write( "<br>HTML") ;
        > document.write( "<br>here ");
        >
        > or:
        >
        > var html = [
        > "your",
        > "HTML",
        > "here"];
        > document.write( html.join("<br> "));
        >
        >[/color]

        thanks alot !! of course it works.
        also thanks to david, although i stick with this solution.

        Comment

        • Jim Ley

          #5
          Re: SSI alternative

          On Fri, 18 Feb 2005 18:08:47 +0100, Ali Babba <AliBabba@40Ban dits.com>
          wrote:
          [color=blue]
          >now the problem is that it only works when all HTML is put in 1 line !
          >and this line cannot be longer than about 255 characters.[/color]

          I've never known any browsers with a 255 character limit, could you
          provide more details of where you worked out the limit?

          Jim.

          Comment

          • Ali Babba

            #6
            Re: SSI alternative

            Jim Ley wrote:[color=blue]
            > On Fri, 18 Feb 2005 18:08:47 +0100, Ali Babba <AliBabba@40Ban dits.com>
            > wrote:
            >
            >[color=green]
            >>now the problem is that it only works when all HTML is put in 1 line !
            >>and this line cannot be longer than about 255 characters.[/color]
            >
            >
            > I've never known any browsers with a 255 character limit, could you
            > provide more details of where you worked out the limit?
            >
            > Jim.[/color]

            255 was a guess, and not a good one.

            i was using windows notepad, and it has apparently somewhere a limit on
            the number of characters in 1 line.

            just checked with a better editor and i didnt get any weird behaviour
            until i arrived around 40k charcters in 1 line.

            Comment

            Working...