473,508 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yet another Mac and IE javascript problem.

I know that there are already a bunch of these requests in the
newsgroup, but no one has answered one that would help me. I have a
site that uses Javascript, http://www.namemaker.com, and one of my
pages doesn't work properly. To view the page, go to the site, select
"100% Woven labels", and select one of the "Buy" buttons. This brings
you to the color selection screen. I have script functions so that
when the user clicks a color, the script puts a box around the user's
choice, and sets the hidden field to the chosen color. It works on
PC's IE and NS. It works on Mac's, NS. On Mac's with IE, nothing
happens when you click (or so I assume from the error reports that the
users send.)

The code that does this is:

<script language="javascript">
<!--
var a, b, c, key;
a={
0:'cream',
1:'white',
2:'pink',
3:'yellow',
4:'lightgray',
5:'lightblue',
6:'lightred',
7:'lightgreen',
8:'navy',
9:'black',
10:'redwine',
11:'darkgreen',
12:'darkgray'};
b={
0:'tbrown',
1:'tred',
2:'tblack',
3:'tgreen',
4:'trose',
5:'tnavy',
6:'tgoldmetallic',
7:'tgoldenyellow',
8:'tsilver',
9:'tviolet',
10:'twhite',
11:'tgray',
12:'tskyblue'};
c={
0:'No',
1:'No',
2:'Yes',
3:'No',
4:'No',
5:'Yes',
6:'No',
7:'No',
8:'No',
9:'No',
10:'No',
11:'No',
12:'No'};
function ProcessBackground(itemNo, ColorName, Dark)
{
for (key in a)
{
cellObj=document.getElementById(a[key]);
if (key==itemNo)
cellObj.style.borderWidth = 2;
else
cellObj.style.borderWidth = 0;
}
document.forms[0].BackgroundColor.value=ColorName;
for (key in b)
{
cellObj=document.getElementById(b[key]);
if ((Dark=='Yes') && (c[key]=='Yes'))
{
cellObj.style.visibility='hidden';
if (cellObj.style.borderWidth=='2px')
{
cellObj.style.borderWidth = 0;
r=ProcessText(0, 'Brown');
}
}
else
cellObj.style.visibility='visible';
}
return;
}
function ProcessText(itemNo, ColorName)
{
for (key in b)
{
cellObj=document.getElementById(b[key]);
if (cellObj.style.visibility=='visible')
{
if (key==itemNo)
cellObj.style.borderWidth = 2;
else
cellObj.style.borderWidth = 0;
}
}
document.forms[0].TextColor.value=ColorName;
return;
}

-->
</script>

How can I fix this problem? I have no Mac to test this with.
Jul 20 '05 #1
3 1356
> I know that there are already a bunch of these requests in the
newsgroup, but no one has answered one that would help me. I have a
site that uses Javascript, http://www.namemaker.com, and one of my
pages doesn't work properly. To view the page, go to the site, select
"100% Woven labels", and select one of the "Buy" buttons. This brings
you to the color selection screen. I have script functions so that
when the user clicks a color, the script puts a box around the user's
choice, and sets the hidden field to the chosen color. It works on
PC's IE and NS. It works on Mac's, NS. On Mac's with IE, nothing
happens when you click (or so I assume from the error reports that the
users send.)
I didn't fire up my Mac, but...

Does nothing in NS7.1 and throws object expected errors in IE5

The html is funky:

<font><a .....></font></a> improperly nested

also:

id="Light Redt" I don't think spaces are permitted in id's

So's the inline CSS:

style="border-style: solid; border-width: 1"> That needs a unit (px), if
it's nonzero. Ditto with providing the unit for the javascript:

cellObj.style.borderWidth = 2;
Jeff
The code that does this is:

<script language="javascript">
<!--
var a, b, c, key;
a={
0:'cream',
1:'white',
2:'pink',
3:'yellow',
4:'lightgray',
5:'lightblue',
6:'lightred',
7:'lightgreen',
8:'navy',
9:'black',
10:'redwine',
11:'darkgreen',
12:'darkgray'};
b={
0:'tbrown',
1:'tred',
2:'tblack',
3:'tgreen',
4:'trose',
5:'tnavy',
6:'tgoldmetallic',
7:'tgoldenyellow',
8:'tsilver',
9:'tviolet',
10:'twhite',
11:'tgray',
12:'tskyblue'};
c={
0:'No',
1:'No',
2:'Yes',
3:'No',
4:'No',
5:'Yes',
6:'No',
7:'No',
8:'No',
9:'No',
10:'No',
11:'No',
12:'No'};
function ProcessBackground(itemNo, ColorName, Dark)
{
for (key in a)
{
cellObj=document.getElementById(a[key]);
if (key==itemNo)
cellObj.style.borderWidth = 2;
else
cellObj.style.borderWidth = 0;
}
document.forms[0].BackgroundColor.value=ColorName;
for (key in b)
{
cellObj=document.getElementById(b[key]);
if ((Dark=='Yes') && (c[key]=='Yes'))
{
cellObj.style.visibility='hidden';
if (cellObj.style.borderWidth=='2px')
{
cellObj.style.borderWidth = 0;
r=ProcessText(0, 'Brown');
}
}
else
cellObj.style.visibility='visible';
}
return;
}
function ProcessText(itemNo, ColorName)
{
for (key in b)
{
cellObj=document.getElementById(b[key]);
if (cellObj.style.visibility=='visible')
{
if (key==itemNo)
cellObj.style.borderWidth = 2;
else
cellObj.style.borderWidth = 0;
}
}
document.forms[0].TextColor.value=ColorName;
return;
}

-->
</script>

How can I fix this problem? I have no Mac to test this with.

Jul 20 '05 #2
Vernon Peppers wrote:
I know that there are already a bunch of these requests in the
newsgroup, but no one has answered one that would help me. I have a
site that uses Javascript, http://www.namemaker.com, and one of my
pages doesn't work properly. To view the page, go to the site, select
"100% Woven labels", and select one of the "Buy" buttons. This brings
you to the color selection screen. I have script functions so that
when the user clicks a color, the script puts a box around the user's
choice, and sets the hidden field to the chosen color. It works on
PC's IE and NS. It works on Mac's, NS. On Mac's with IE, nothing
happens when you click (or so I assume from the error reports that the
users send.)

The code that does this is:

<script language="javascript">
<!--
var a, b, c, key;
a={
0:'cream',
1:'white',
2:'pink',
3:'yellow',
4:'lightgray',
5:'lightblue',
6:'lightred',
7:'lightgreen',
8:'navy',
9:'black',
10:'redwine',
11:'darkgreen',
12:'darkgray'};


You are creating properties, and accessing them with array notation.

I'm not saying that's definitely the problem, I don't have a Mac but
that's weird. Why aren't you using Arrays?

var a = ["cream", "white", "pink" ...];
var b = ["foo", "bar"...];

Documentation:
http://devedge.netscape.com/library/...t.html#1011655

Nige

Jul 20 '05 #3
ExGuardianReader <no***@noway.com> wrote in message news:<bv**********@hercules.btinternet.com>...
Vernon Peppers wrote:
I know that there are already a bunch of these requests in the
newsgroup, but no one has answered one that would help me. I have a
site that uses Javascript, http://www.namemaker.com, and one of my
pages doesn't work properly. To view the page, go to the site, select
"100% Woven labels", and select one of the "Buy" buttons. This brings
you to the color selection screen. I have script functions so that
when the user clicks a color, the script puts a box around the user's
choice, and sets the hidden field to the chosen color. It works on
PC's IE and NS. It works on Mac's, NS. On Mac's with IE, nothing
happens when you click (or so I assume from the error reports that the
users send.)

The code that does this is:

<script language="javascript">
<!--
var a, b, c, key;
a={
0:'cream',
1:'white',
2:'pink',
3:'yellow',
4:'lightgray',
5:'lightblue',
6:'lightred',
7:'lightgreen',
8:'navy',
9:'black',
10:'redwine',
11:'darkgreen',
12:'darkgray'};


You are creating properties, and accessing them with array notation.

I'm not saying that's definitely the problem, I don't have a Mac but
that's weird. Why aren't you using Arrays?

var a = ["cream", "white", "pink" ...];
var b = ["foo", "bar"...];

Documentation:
http://devedge.netscape.com/library/...t.html#1011655

Nige


I'm not using arrays because I am a newbie at Javascript, and I found
an example of how to do this on the web. I just used it and it seemed
to work. Thanks for the tip. I'll look into it.
Jul 20 '05 #4

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

Similar topics

13
9400
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
53
5656
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
6
2256
by: Alex Rast | last post by:
First of all, this is not a programming question. I'm a user, not programming in JavaScript. I'm not, however, a novice user or even a power user - I certainly know programming intimately as well...
136
9201
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
7120
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...
0
7380
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...
1
7039
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...
0
7494
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...
0
5626
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,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
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...
0
3192
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...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.