By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

SSI alternative

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Ali Babba" <Al******@40Bandits.com> wrote in message
news:cv**********@news.hispeed.ch...
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


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>"));
Jul 23 '05 #2

P: n/a
Ali Babba wrote:
my ISP doesnt support SSI and therefor i try to javascript to get the
same think done.


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
Jul 23 '05 #3

P: n/a
McKirahan wrote:
"Ali Babba" <Al******@40Bandits.com> wrote in message
news:cv**********@news.hispeed.ch...
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

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>"));


thanks alot !! of course it works.
also thanks to david, although i stick with this solution.
Jul 23 '05 #4

P: n/a
On Fri, 18 Feb 2005 18:08:47 +0100, Ali Babba <Al******@40Bandits.com>
wrote:
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've never known any browsers with a 255 character limit, could you
provide more details of where you worked out the limit?

Jim.
Jul 23 '05 #5

P: n/a
Jim Ley wrote:
On Fri, 18 Feb 2005 18:08:47 +0100, Ali Babba <Al******@40Bandits.com>
wrote:

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've never known any browsers with a 255 character limit, could you
provide more details of where you worked out the limit?

Jim.


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.
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.