PDA

View Full Version : Javascript - Problem with accountancy calculators in Safari



f_m_lil
09-25-2011, 09:13 PM
Hi Everyone

I am wondering if anyone can help...
I am currently working on a site(url: currently on www.fayelittlewood.co.uk)
I have had some help with the code as I am more of a designer than a coder.

I have some accountancy calculators on my page
http://www.fayelittlewood.co.uk/calculators.html
It seems to work fine in internet explorer but when you fill in your information in any other browser nothing happens when you click submit

Has anyone got any ideas what the problem could be, I am presuming it is a javascript problem but I may be wrong?

Thanks in advance

Faye

jscheuer1
09-25-2011, 09:38 PM
On vatcalculator.html the script (presumably the one for doing the calculations) is linked in with this tag:



<script src="C:\Users\Faye\Desktop/vat_20percent.js" type="text/javascript"></script>

That script is on your computer. So it won't work in any browser, except one on your computer. Furthermore IE is the only browser that will read a path, even one on the local machine, that uses the \.

I imagine the other calculators suffer from the same issue.

Put that and the other calculator scripts on the server if you haven't already and change the src attribute of the above and the corresponding script tags to point to their locations on the server.

The browser cache may need to be cleared and/or the page refreshed to see changes.

And, there could be other problems with other browsers. At least we know the script works in IE. But this much needs to be done for it to even have a chance of working in those other browsers, any browser really, unless it happens to be IE and happens to be on your computer.

f_m_lil
09-29-2011, 07:27 PM
Brilliant! Did what you said and now works fine in other browsers. Thanks for your help