create a web page with javascript on fly

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

    #16
    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.

    Comment

    • datactrl

      #17
      Re: create a web page with javascript on fly

      > Sometimes. But sometimes you get an error because newWindow.docum ent[color=blue]
      > has no properties, because the O/S hasn't opened the new window fast
      > enough, so you're trying to write into a window that isn't ready.
      >
      > globalHTML=s;
      > window.open("ja vascript:opener .globalHTML");
      >
      > is more reliable.[/color]

      This works fine. But sometimes it will open a blank window without any
      content. Is there any way to work arround this problem? Thanks in advance!

      Jack


      Comment

      Working...