Line spacing error in Mozilla?

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

    Line spacing error in Mozilla?

    Hi,
    I have a function which reads all lines from an array and writes them with
    the required tags. This works fine with IE, but not with Mozilla.
    On http://users.pandora.be/nenya/test/linespacing.htm I write the text both
    in a script and as plain HTML.
    http://users.pandora.be/nenya/test/linespacing.jpg shows what Mozilla makes
    of it. In IE the part "written by script" displays the same as "plain HTML".
    Does anyone have an idea what's wrong here? Does Mozilla have a bug where
    Internet Exploder doesn't?

    --
    Steven
    (remove pants to reply by e-mail)


  • Janwillem Borleffs

    #2
    Re: Line spacing error in Mozilla?


    "Steven" <stevenpantsvh@ pandora.be> schreef in bericht
    news:WeQNa.8212 $7h.12775@afrod ite.telenet-ops.be...[color=blue]
    > Hi,
    > I have a function which reads all lines from an array and writes them with
    > the required tags. This works fine with IE, but not with Mozilla.
    > On http://users.pandora.be/nenya/test/linespacing.htm I write the text[/color]
    both[color=blue]
    > in a script and as plain HTML.
    > http://users.pandora.be/nenya/test/linespacing.jpg shows what Mozilla[/color]
    makes[color=blue]
    > of it. In IE the part "written by script" displays the same as "plain[/color]
    HTML".[color=blue]
    > Does anyone have an idea what's wrong here? Does Mozilla have a bug where
    > Internet Exploder doesn't?
    >[/color]

    It's the way Mozilla renders the lines written by document.write. To
    simulate the way IE does it, just prepare a variable and write the text at
    once when the loop is finished:

    var text = '';
    for (var i=0; i<q.length; i++) {
    .....
    text += '<tr>';
    text += '<td class="body"><p >' + a2[0] + '</p>';
    text += '<p class="qref">' + a2[1] + '</p></td>';
    text += '</tr>';
    }
    document.write( text);


    JW



    Comment

    • Steven

      #3
      Re: Line spacing error in Mozilla?


      "Janwillem Borleffs" <jwb@jwbfoto.de mon.nl> schreef in bericht
      news:3f07f45e$0 $28907$1b62eedf @news.euronet.n l...[color=blue]
      >
      > "Steven" <stevenpantsvh@ pandora.be> schreef in bericht
      > news:WeQNa.8212 $7h.12775@afrod ite.telenet-ops.be...[color=green]
      > > Hi,
      > > I have a function which reads all lines from an array and writes them[/color][/color]
      with[color=blue][color=green]
      > > the required tags. This works fine with IE, but not with Mozilla.
      > > On http://users.pandora.be/nenya/test/linespacing.htm I write the text[/color]
      > both[color=green]
      > > in a script and as plain HTML.
      > > http://users.pandora.be/nenya/test/linespacing.jpg shows what Mozilla[/color]
      > makes[color=green]
      > > of it. In IE the part "written by script" displays the same as "plain[/color]
      > HTML".[color=green]
      > > Does anyone have an idea what's wrong here? Does Mozilla have a bug[/color][/color]
      where[color=blue][color=green]
      > > Internet Exploder doesn't?
      > >[/color]
      >
      > It's the way Mozilla renders the lines written by document.write. To
      > simulate the way IE does it, just prepare a variable and write the text at
      > once when the loop is finished:
      >
      > var text = '';
      > for (var i=0; i<q.length; i++) {
      > .....
      > text += '<tr>';
      > text += '<td class="body"><p >' + a2[0] + '</p>';
      > text += '<p class="qref">' + a2[1] + '</p></td>';
      > text += '</tr>';
      > }
      > document.write( text);
      >
      >
      > JW
      >
      >[/color]

      Solved!
      Bedankt Janwillem

      Steven


      Comment

      Working...