Re: create a web page with javascript on fly
Dr John Stockton wrote:
[snip][color=blue]
> If you use i++ rather than ++i, then the first line can have the same
> LHS as the rest, and the first para will be paragraph 1 - ISTM.
>
> How about
> var s = [
> " <p>here is paragraph " + 1 + "</p>",
> " <p>here is paragraph 2 </p>",
> " <p>here is paragraph 3 </p>",
> ...
> "" ].join("") ;
>
> taking the view that self-numbering paragraphs are probably not needed?[/color]
Looks great. I auto-numbered the paras just for the sake of
it, no real purpose.
Rob.
Dr John Stockton wrote:
[snip][color=blue]
> If you use i++ rather than ++i, then the first line can have the same
> LHS as the rest, and the first para will be paragraph 1 - ISTM.
>
> How about
> var s = [
> " <p>here is paragraph " + 1 + "</p>",
> " <p>here is paragraph 2 </p>",
> " <p>here is paragraph 3 </p>",
> ...
> "" ].join("") ;
>
> taking the view that self-numbering paragraphs are probably not needed?[/color]
Looks great. I auto-numbered the paras just for the sake of
it, no real purpose.
Rob.
Comment