...

View Full Version : Multiple (text) spaces in Moz....



adios
10-19-2004, 08:52 AM
Does anyone here know how to append whitespace nodes in mozilla without them being 'compressed'? Sampled numerous possibilities including '\u0020' but multiple spaces invariably get crunched down to one (MSIE is cooperative).

hemebond
10-19-2004, 10:01 AM
You mean like   ?

adios
10-19-2004, 10:15 AM
Compare these, cross-browser:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>untitled</title>
</head>
<body>
<div id="x1"></div>
<div id="x2"></div>
<div id="x3"></div>
<script type="text/javascript">
var spaces = '\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020\u0020';
document.getElementById('x1').appendChild(document.createTextNode('#' + spaces + '#'));
var spaces = ' ';
document.getElementById('x2').appendChild(document.createTextNode('#' + spaces + '#'));
var spaces = '# #';
document.getElementById('x3').appendChild(document.createTextNode(' ')).data = spaces;
</script>
</body>
</html>

adios
10-19-2004, 07:26 PM
OK, found it (http://www.faqts.com/knowledge_base/view.phtml/aid/5887/fid/255). God Bless everyone. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum