Google Answers Logo
View Question
 
Q: JavaScript problem in Safari browser ( No Answer,   0 Comments )
Question  
Subject: JavaScript problem in Safari browser
Category: Computers > Programming
Asked by: kschoenwandt-ga
List Price: $10.00
Posted: 10 Jan 2004 22:53 PST
Expires: 20 Apr 2004 21:13 PDT
Question ID: 295216
I have build a sort of calculator where a person can enter their
weight in either imperial pounds or kilos and would receive a
"winning" dollar (CAN$) value based on the price of gold (CAN$ 539.84
per troy ounce) -- one ounce for each imperial pound (code is here:
http://www.schoenwandt.net/safaritest/). This was obviously for a
promotion for a client. I tested this on PC in IE 6.x, NS 6.x, Mozilla
Firebird, and on Mac OS 9 on NS 6.2 (I think) and IE 5, as well as on
Mac OS X on IE (recent version not sure right now which).
I can not get it to work on Safari on OS X! While the numbers enter OK
on the screen, I can not toggle between Lb/Kg and can not "calculate"
the result. In both cases the code asks for the image on the left side
of the read-out screen to be changed to reflect the current "state"
(Lb, Kg, or $).
I am looking for a fix so that it works on the Safari browser as well. I am
looking for the complete code based in the sample in URL above.
Thank you all in advance!

Request for Question Clarification by joseleon-ga on 13 Jan 2004 15:01 PST
Hello,
  I cannot test it with safari because I don't have a mac, but like
safari is based on kde konqueror, I can perform some tests on Linux,
would you be interested?

Regards.

Request for Question Clarification by supermacman-ga on 13 Jan 2004 18:35 PST
This may not work, and might not even matter, but you know, the
craziest ideas might be the ones that work.

On the sources, you have lots of event handlers onmousedown and
onmouseup. They are in the format:

onmousedown=this.src='images/calc/7_on.gif'
onmouseup=this.src='images/calc/7_off.gif' onclick=NumPressed(7)

Try putting them in the following format:

onClick="NumPressed(7)"

Note capitalization and quotes. If this doesn't work, adding capitals
and putting quotes is good JavaScript style, anyway.

Clarification of Question by kschoenwandt-ga on 13 Jan 2004 21:14 PST
Hello joseleon: 
I don't know if the Linux test would be representative enough. 
I would like to have it tested in Mac OSX / Safari. 
Thanks anyways.

Clarification of Question by kschoenwandt-ga on 13 Jan 2004 21:25 PST
Hello supermacman: 
all the onMouseUp and onMouseDown lines are autogenreated by a PHP
function, that is why I got lazy with the quotes. As you said, proper
capitals and quotes are good practice, and therefore I will fo that...
But this is not the issue I trust. The numbers get written well as
they are. The unit toggle [onclick="UnitToggle('lb')"] and the
calculate [onclick="getResult()"] are the offending functions.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy