473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Javascript not working in Netscape 7.1

OS system is Windows XP Pro SP2.

The following works perfectly in IE but not at all in Netscape:

<tr>
<td valign="middle" background="dull.gif"
onMouseOver="this.background='bright.gif';"
onMouseOut="this.background='dull.gif';"
bgcolor="#FFFFFF">
<img src="vspacer.gif" height="46" width="20" align="left">
<span style = "font-size : 6pt">&nbsp;<br></span>
<span style="color : 000000; font-size : 9 pt;
font-family : arial, sanserif">
<a href="./notices/board.htm"><b>Notice Board</b></a></span></td>
</tr>

It's as if Javascript is turned off in Netscape. Is that an effect of
installing XP SP2? How do I get Javascript to work in Netscape?
Jul 23 '05 #1
2 1395
On Tue, 28 Sep 2004 20:09:51 GMT, Norman Swartz <sw****@sfu.ca> wrote:
OS system is Windows XP Pro SP2.

The following works perfectly in IE but not at all in Netscape:

<tr>
<td valign="middle" background="dull.gif"
onMouseOver="this.background='bright.gif';"
onMouseOut="this.background='dull.gif';"
You should probably be using the style object.
bgcolor="#FFFFFF">
<img src="vspacer.gif" height="46" width="20" align="left">
A spacer GIF? See below.
<span style = "font-size : 6pt">&nbsp;<br></span>
If you need some spacing, place a top margin on the link, or a bottom
margin on the image. Don't hack with non-breaking spaces and font sizes.
The Web should be moving past that rubbish now.
<span style="color : 000000; font-size : 9 pt;
A hash (#) is required to prefix three- or six digit hexadecimal colour
codes.

Don't use pt, px, or any other fixed measurement for font sizes. It makes
text affected by them impossible to resize in some browsers. Use ems or
percentages instead.
font-family : arial, sanserif">
That should be:

font-family: Arial, sans-serif;
<a href="./notices/board.htm"><b>Notice Board</b></a></span></td>
</tr>
As a general comment, why the piecemeal approach to CSS? Everything that
you seem to be attempting can be done with CSS[1] yet you've got some
presentational HTML, some CSS, and some HTML hacks that you'd only expect
from errant WYSIWYG programs like FrontPage.

Documents should now be written with Strict HTML and CSS, unless it's a
legacy page that would take too much effort to fix, or that needs to be
Transitional for some other reason. Be forward-looking, not stuck in the
past!
It's as if Javascript is turned off in Netscape. Is that an effect of
installing XP SP2?
It shouldn't be. Netscape's JavaScript implementation is completely
separate from Microsoft's. Any changes to one should have no effect on the
other. I have SP2 and Netscape executes scripts with no problem. I assume
you've checked for error messages?
How do I get Javascript to work in Netscape?


By selecting it in the options. :P

Seriously though, write a very small, simple test page. A lone alert will
do. If you get nothing, consider reinstalling Netscape.

Good luck,
Mike
[1] Yes that includes the mouse-over, but it won't be supported by IE so
we'll ignore that for the time being.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
Norman Swartz <sw****@sfu.ca> writes:
OS system is Windows XP Pro SP2.

The following works perfectly in IE but not at all in Netscape:
Which Netscape?
I'll assume it's a verson 6 or later (preferably much later).
<tr>
<td valign="middle" background="dull.gif"
The "td" element doesn't have a "background" attribute in W3C HTML.
It might be a proprietary Microsoft extension.

<URL:http://www.w3.org/TR/html4/struct/tables.html#h-11.2.6>

Remember to validate your HTML before trying to fix Javascript
problems. Invalid HTML can cause otherwise good Javascript
to fail (although that is not the case here).
onMouseOver="this.background='bright.gif';"
The W3C HTML DOM doesn't have a "background" property for
HTMLInputElement's either.

<URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025>

That would explain why it doesn't work as you expect in Netscape. They
might honor the "background" HTML attribute in order to support bad
pages, but there is a limit to how far they'll go.
It's as if Javascript is turned off in Netscape.
Insert a few alerts, and it's clear that it isn't. The assignment of a
string to the property called "background" just doesn't do anything
except ... well, assign.
Is that an effect of installing XP SP2?
Almost certainly not. The Netscape browser is not affected by patches
to Microsoft software.
How do I get Javascript to work in Netscape?


Write standards compliant code instead of just writing for IE.
I suggest using CSS for styling and DOM-compliant javascript:
---
<td style="vertical-align: middle; background: #fff url(dull.gif)"
onmouseover="this.style.backgroundImage='url(brigh t.gif)';"
onmouseout="this.style.backgroundImage='url(dull.g if)';">
...
</td>
---

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Binny V A | last post by:
Hello Everyone, I am writing an tutorial(http://www.geocities.com/binnyva/code/javascript/basic_tutorial/index.html) for JavaScript and I wanted to include the link of the Netscape's official...
10
by: VictorG | last post by:
Hello, I am new to JS and am trying to add some HTML into a JS function. So that when called the script as well as the HTML will be invoked. Is there some type of embed mechanism, sort of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.