Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript not working on IE9 but one every other browser? What's wrong?
    primarykey
    data
    text
    <p>I've been working on this little app and it works just fine in every browser I can try (I'm on a Mac) and I've tried Firefox, Chrome, Opera, and Safari and it works. I sent it to a co-worker (who uses a PC) and he said it works on Chrome, Firefox, and Opera, but not IE9. </p> <p>I had another co-worker try it and he said it works on Chrome but not on IE9.</p> <p>So far, it seems to work on every browser except IE9. Another coworker said the first time in Chrome it just refreshed the screen, then he re-entered everything and it worked fine after that even with repeated uses.</p> <p>Can anyone tell what's wrong with it? This is my first real use application so I'm sorry if the issue is obvious to everyone.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Daily Calorie Limit&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript" language="javascript"&gt; function Calculate() { var gender = document.getElementById("gender").value; var weight = document.getElementById("weight").value; var inches = parseInt(document.getElementById("inches").value, 10); var height = (parseInt(document.getElementById("feet").value, 10) * 12) + inches; var age = document.getElementById("age").value; var goal = document.getElementById("goal").value; if(gender=="male") { val1 = 6.23 * weight; val2 = 12.7 * height; val3 = 6.8 * age; dailyDeficit = (goal * 3500) / 90; result = 66 + val1 + val2 - val3; cals = result * 1.55; calMax = cals - dailyDeficit; } else if (gender=="female") { val1 = 6.23 * weight; val2 = 4.7 * height; val3 = 4.7 * age; dailyDeficit = (goal * 3500) / 90; result = 655 + val1 + val2 - val3; cals = result * 1.55; calMax = cals - dailyDeficit; } document.getElementById("answer").textContent = 'Your Daily Calorie Limit is: ' + calMax.toFixed(0); } &lt;/script&gt; &lt;form action="#"&gt; Gender : &lt;select id="gender"&gt;&lt;option value="male"&gt;Male&lt;/option&gt;&lt;option value="female"&gt;Female&lt;/option&gt;&lt;/select&gt;&lt;br /&gt; Weight : &lt;input type="text" id="weight" /&gt;lbs.&lt;br /&gt; Height : &lt;input type="text" id="feet" /&gt;ft. &lt;input type="text" id="inches" /&gt;in.&lt;br /&gt; Age : &lt;input type="text" id="age" /&gt;&lt;br /&gt; Goal : &lt;select id="goal"&gt;&lt;option value=5&gt;Lose 5 Pounds&lt;/option&gt;&lt;option value=10&gt;Lose 10 Pounds&lt;/option&gt;&lt;option value=15&gt;Lose 15 Pounds&lt;/option&gt;&lt;option value=20&gt;Lose 20 Pounds&lt;/option&gt;&lt;option value=25&gt;Lose 25 Pounds&lt;/option&gt;&lt;/select&gt;&lt;br /&gt; &lt;/fieldset&gt; &lt;input type="submit" value="Give me my Daily Calorie Limit!" onclick="Calculate()" /&gt; &lt;/form&gt; &lt;div id="answer"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload