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

Line spacing error in Mozilla?

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


P: n/a

"Steven" <st***********@pandora.be> schreef in bericht
news:We*****************@afrodite.telenet-ops.be...
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?


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

Jul 20 '05 #2

P: n/a

"Janwillem Borleffs" <jw*@jwbfoto.demon.nl> schreef in bericht
news:3f***********************@news.euronet.nl...

"Steven" <st***********@pandora.be> schreef in bericht
news:We*****************@afrodite.telenet-ops.be...
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?


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


Solved!
Bedankt Janwillem

Steven
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.