473,748 Members | 8,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="dul l.gif"
onMouseOver="th is.background=' bright.gif';"
onMouseOut="thi s.background='d ull.gif';"
bgcolor="#FFFFF F">
<img src="vspacer.gi f" 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>N otice 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 1412
On Tue, 28 Sep 2004 20:09:51 GMT, Norman Swartz <sw****@sfu.c a> 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="dul l.gif"
onMouseOver="th is.background=' bright.gif';"
onMouseOut="thi s.background='d ull.gif';"
You should probably be using the style object.
bgcolor="#FFFFF F">
<img src="vspacer.gi f" 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>N otice 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.c a> 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="dul l.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="th is.background=' bright.gif';"
The W3C HTML DOM doesn't have a "background " property for
HTMLInputElemen t'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="th is.style.backgr oundImage='url( bright.gif)';"
onmouseout="thi s.style.backgro undImage='url(d ull.gif)';">
...
</td>
---

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.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
2094
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 JavaScript manuals in the reference section. JavaScript Guide http://developer.netscape.com/library/documentation/communicator/jsguide4/index.htm
10
4589
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 reverse of embedding JS in an html page with the script tag. (which is what I am doing in this case) Is this even possible?
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.