Netscape 4 troubles.

liunx

Guest
I have a text string which is being put together in javascript. It is basically a long list of links which are supposed to represent page numbers. The text is being written to the page with document.write() in a table cell.<br />
<br />
Netscape 6 / MSIE 4+5 keep this text string on ONE line, but<br />
Netscape 4 insist on making line breaks after each link. I have tried to put &nbsp; in between the links as spacers and also wrapped the entire string in <nobr></nobr> tags, to no avail. I am not using layers, or DHTML or anyting like that. Regular javascript and an old fashioned document.write().<br />
<br />
Here is what I have:<br />
<br />
var outtxt = "Navigation: pages: ";<br />
var linkAry = ["page1.html","page2.html", .., "page8.html"];<br />
<br />
for (var i=1;i<=linkAry.length;i++){<br />
outtxt+= " - <a href= 'http://www.htmlforums.com/archive/index.php/"+linkAry[ i ]+"' ><B>"+i+"</B></a>";<br />
}<br />
<br />
document.write(outtxt);<br />
<br />
The result should look like this:<br />
<br />
Navigation: pages: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8<br />
<br />
<br />
Netscape 4 insist on show it as:<br />
Navigation:<br />
Pages:<br />
- 1 <br />
- 2<br />
- 3<br />
- 4<br />
- 5<br />
- 6<br />
- 7<br />
- 8<br />
<br />
<br />
<br />
Does anyone have experiences with this kind of behaviour in Netscape 4. I assume it is the links that make it break, but what can I do to keep them together ?<br />
<br />
Any ideas ?<br />
<br />
Kenneth<!--content-->Hi kd,<br />
as this is javascript related you might like to post this in the client side scripting forum and see if the guru's there can help........ ohhh :D you are one..hahaha<br />
<br />
Hey, actually I would like to see whats going on there, can you throw an example online and post the url please?<br />
Thanks :)<!--content-->I use netscape 4.7 for testing. Everything was ok. Hmmm...<br />
So, I would advice to place output in the table and add NOWRAP attribute to the TD tag.<!--content-->Thanks Ian and Mooncat (.. Like the name ..)<br />
Maybe my question was a bit out of context, because it was actually not the javascript which did anything to upset the layout.. I had same result if hard-coded links into the page. The layout, as Mooncat pointed out, was not a problem if you used the little example, but combined with my horrible, horrible use of nested with nested tables of percentage related sizes NS4 managed to make it's own version.<br />
It turned out that the stylesheet for the table cell had: text-align: center; Netscape 4 took this literally and centered all links, one after the other. I took out this text-align stylesheet setting and put <td align="center"> into the tag, and whoopsa.. problem solved..<br />
<br />
Maybe this is not so strange.. e.g. that Netscape 4 is more reliable with decrepciated markup and bark at stylesheet markeup. <br />
<br />
Being a semi-perfectionist I wanted to do it the w3c way, but had to gracefully abandon this idea and add the align attribute to the tag (plus some other problems solved with hardcoded <font> tags.. uhh).. The HTML 4.01 validator from w3c had a hissy fit when going through my site, so no chance of any fancy "html4 approved" buttons for the moment.<br />
<br />
Who knows.. One of these days I'll give up on Netscape 4 and program everything according to w3c. If visitors get strange results they can chose a browser which support standards for all I care.. If they insist on Solairs, outdated Netscape browsers, or Microsoft Internet Explorer 4.0 for windows or mac, then sorry o' that's your own problem.. <br />
Sounded crazy to me when <!-- m --><a class="postlink" href="http://www.alistapart.com/">http://www.alistapart.com/</a><!-- m --> first suggested it, but the more I think about the more sence it makes..<br />
<br />
Ok now I am rambling.. better stop before Ian closes the thread.<br />
<br />
remember: no such think as bad browsers.. only bad programmers (NS4 you are killing me here !!!)<!--content-->
 
Back
Top