We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Цей вебсайт матиме обмежену функціональність, доки ми проводимо його обслуговування для поліпшення роботи. Якщо прочитана стаття не розв'язала вашу проблему і ви хочете поставити питання, наша спільнота підтримки з радістю допоможе вам на @FirefoxSupport у Twitter та /r/firefox на Reddit.

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Javascript Calculator no longer works in FF. Other browsers OK.

  • 5 відповідей
  • 1 має цю проблему
  • 14 переглядів
  • Остання відповідь від Wikiwide

more options

I have a javascript calculator that has suddenly stopped working in FF. I have upgraded from 3.5.8 to 3.6.3 but no changes. IE, Safari, Chrome and Opera all work fine.

Calculator can be found at http://www.hydrastop.be/hprodCalc.html

I have a javascript calculator that has suddenly stopped working in FF. I have upgraded from 3.5.8 to 3.6.3 but no changes. IE, Safari, Chrome and Opera all work fine. Calculator can be found at http://www.hydrastop.be/hprodCalc.html

Усі відповіді (5)

more options

Please, contact site developers about their Javascript.

var one = eval(document.theForm.elements[0].value) var two = eval(document.theForm.elements[1].value) var m2 = Math.round(one * two) squareMeters.innerHTML = m2 Error: squareMeters is not defined

It seems the code doesn't declare squareMeters beforehand.

more options

Hi

Afraid that didn't help. BTW when I posted this question I could not see what I was typing at all. All fields looked blank but cursor moved along. drop downs were empty. But I see the post worked :-)

Thanks for trying. The script was working for about 4 months, then it stopped. Basically in FF you click the submit 'Resultaat' button and nothing happens.

r/R

more options

Having a badly written script that used to work for whatever reasons of lax implementations is no excuse not to improve the script when implementations follow the standards more closely.

more options

I fixed the script (locally) by declaring everything and there is no change in Firefox. That is what I meant to say. I will improve the script but it doesn't solve the issue.

more options

I see that the answer that I posted yesterday got lost by restoring a forum backup, so I'll repost my answer. I see that you have already applied the change that I had suggested. --- You need to use document.getElementById. See https://developer.mozilla.org/en/DOM/document.getElementById

function doMath() { var one = eval(document.theForm.elements[0].value); var two = eval(document.theForm.elements[1].value); var m2 = Math.round(one * two); var m3 = Math.round(one * two); var maxhstopqty = Math.round(m2 / 5); var minhstopqty = Math.round(m2 / 8); var minhblockqty = Math.round(m2 / 5); var maxhblockqty = Math.round(m2 / 3); document.getElementById('squareMeters').innerHTML = m2; document.getElementById('squareMeters2').innerHTML = m3; document.getElementById('minhstopReq').innerHTML = minhstopqty; document.getElementById('maxhstopReq').innerHTML = maxhstopqty; document.getElementById('minhblockReq').innerHTML = minhblockqty; document.getElementById('maxhblockReq').innerHTML = maxhblockqty; }