Jump to content

New ratio calculator tool


ashtrans

Recommended Posts

I'm not too familiar with JS, but i've done a bit here and there, and the $(#objectname) syntax they've used seems particularly obscure to me?

The first drop down should just be hard coded into the list, but they've done it like that so all the data is stored in one place. If you want to add another gearbox, you just open the "arrays.js" and add it there, rather than having to add it to both the PHP page and the JS file.

Link to comment
Share on other sites

Wouldn't hard coding list contents prevent those like myself who don't always use Land Rover components in the drive train from entering alternate values?

While I see the need for fixing it to work with all popular browsers (and Dave apparently agrees), why clip it's versatility in other ways?

I found the calculator worked well in that respect, using chrome.

My only criticism (small) is the use of the same output speed range/increment for lo and hi box - with my low gearing (and I don't have an underdrive) the results aren't particularly useful or are not output in 1st and 2nd. As I see this issue it is simply because an inappropriate hard coded increment value of 10 (kph or mph) for lo box (damb there's that hard coding causing more problems rolleyes.gif )

Link to comment
Share on other sites

Wouldn't hard coding list contents prevent those like myself who don't always use Land Rover components in the drive train from entering alternate values?

While I see the need for fixing it to work with all popular browsers (and Dave apparently agrees), why clip it's versatility in other ways?

I found the calculator worked well in that respect, using chrome.

My only criticism (small) is the use of the same output speed range/increment for lo and hi box - with my low gearing (and I don't have an underdrive) the results aren't particularly useful or are not output in 1st and 2nd. As I see this issue it is simply because an inappropriate hard coded increment value of 10 (kph or mph) for lo box (damb there's that hard coding causing more problems rolleyes.gif )

I was only suggesting hard-coding in the known list of gearboxes, there could easily be an option for custom, at which point the boxes could have the values entered by the user.

Where there is a known list of possibilities and that list is not going to change (ie. a list of boxes, LT77, R380, Custom) there is no reason not to hard-code.

Link to comment
Share on other sites

It's as shorthand for GetElementByID. It's part of the Prototype/jQuery framework (can't remember which) :unsure:

jQuery, although a lot of frameworks are using that syntax these days (not that I like it, but that's another story).

There is no need to hard code anything. The data should be stored in a properly designed database, output by PHP in a format (probably JSON or similar) so that JS can read it. For calculations like these there's absolutely no reason to reload the page (although it's slightly easier), and it would be downright retarded to use AJAX and have PHP calculate it.

Si, I suppose you mean outputting it all and using JS to unhide the appropriate lists. That would work, but wouldn't be very clean.

If I were bored and motivated enough (and I'm only one of those), I'd make one myself :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy