I have a page that calculates some values on the fly whenever a key is
pressed (using keyup(); ). Here is the script (go easy on me, I'm a
noob):

$(document).ready(function() {
        $(document).keyup(function() {
                var ph = $("input#ph").val();
                var targetMSO2 = $("input#target-mso2").val();
                var currentFSO2 = $("input#target-fso2").val();
                var exp = ph - 1.83;
                var currentMSO2 = currentFSO2 / ( 1 + Math.pow(10, exp) );
                var reqFSO2 = targetMSO2 * ( 1 + Math.pow(10, exp) );
                if (currentMSO2 > 0) {
                        $("span#output-mso2").text(roundNumber(currentMSO2,2) + 
" ppm");
                } else {
                        $("span#output-mso2").text("");
                }
                if (reqFSO2 > 0 ) {
                        $("span#output-fso2").text(roundNumber(reqFSO2, 0) + " 
ppm");
                } else {
                        $("span#output-fso2").text("");
                }
        });
});

This works in FF3.5 (OSX), Safari, and Chrome, and _not_ in FF3 (for
PC) or IE7. You can see a working example at 
http://wineadds-heroku.com/so2/molecular

Any ideas? Strange that FF is misbehaving, makes me wonder if my Dell
laptop is not sending the keyboard events the way the browser expects?

Thanks for any help,

Stu

Reply via email to