Page 1 of 1

Mac OS X Safari Javascript Malfunctions

Posted: Wed Feb 21, 2007 8:52 pm
by Ambush Commander
Recently, I had to use a Mac OS X to do some assignments. After I completed, I decided to test out a JavaScript application I had written, after all, I don't get to use Safari every day. To my dismay, it didn't work! Or, at least, a major part of it was broken: The initial JavaScript that generated the question, but when I clicked a button to submit my answer, somehow the event handler wasn't working.

I didn't get enough time to investigate the issue thoroughly, nor was I able to get down Safari or Mac OS X's version (I really should have... sorry). Has anyone heard of anything like this before? I'm using Prototype.js for event-handling.

Posted: Thu Feb 22, 2007 2:36 pm
by jyhm
For a lot of reasons I choose FireFox over Safari. I'm also curious as to the version of Safari you are using and did you check it on newer versions? I am looking at your project on Safari and it seems to work in both browser the same.

I am curious as to how I am supposed to figure out that first question? If I don't know the weight of the object how do I figure. Or more importantly, the rate at which the object starts to gradually lose energy in the form of forward motion. What formula are you using?

Posted: Sat Feb 24, 2007 5:43 pm
by Ambush Commander
It appears that the newest version of Webkit doesn't have this problem, I used Swift on my Windows box and things worked okay. I could get a Portable Firefox with Mac deployment setup, but it'll be slow and complicated. Some really obscure bug on an older version, I guess. More info coming later once I get my hands on one of them.
I am curious as to how I am supposed to figure out that first question? If I don't know the weight of the object how do I figure. Or more importantly, the rate at which the object starts to gradually lose energy in the form of forward motion. What formula are you using?
Air resistance is neglected, and we're assuming earth gravity conditions (g=-9.8 m/s^2). The formula is:

Code: Select all

var rad = this.angle * Math.RpD;
        var a = -4.9;
        var b = this.speed * Math.sin(rad);
        // technically speaking, the equations involved use d_y, which 
        // actually is negative. At first glance, it makes more sense to
        // deal in terms of initial height rather than distance traveled
        // in y (a negative vector quantity). We've adopted a defense in
        // depth measure and decided to make c positive under all circumstances,
        // and ignore situations where the projectile is shot from underground.
        var c = Math.abs(this.height); // = -d_y
        var t = Math.quadratic(a, b, c); // time
        return this.speed * Math.cos(rad) * t;

Posted: Mon Feb 26, 2007 2:05 pm
by jyhm
Thats cool. It sounds like this is an academic project for or by a student. My favorite formula is the formula for Uniform Motion, D=RT. But I don't think I can remember doing any of the scenarios you are doing. My algebra is a blur now, and my use of intricate math with PHP/JS is slight. So I will have to digest your code. :D

Good Luck. AC