I’m in the process of developing an easy-to-use comparison table for users who are looking to upgrade their processor, using the Intel GM965 chipset. It can be found here – http://dylricho.com/archive/gm965/
I was actually making it for myself since I’m going to go from an M 575 to a T9500 soon, but I thought I might as well upload it for others to use.
Regardless, I’ve been trying to find out a simple way to use jQuery/JavaScript to multiply or divide a number (found in a table cell element) by 1000. As an example, this would be used if the user wanted to convert gigahertz into megahertz so comparing multiple CPUs was easier.
As you can see from the link above, I have one way working, although I’m having to list each processor entry manually in the JS file. I was hoping there was a simple way to grab each value of the Clock Frequency column and multiply or divide in one click of the red units in the table headers.
In my mind, I had a code like this which looks like it should work, but it doesn’t:
$('.clock').text() / 1000; // To get back to GHz from MHz
The necessary JS files are listed below for convenience:
- dylricho.com/archive/gm965/changeTitlesOnLoad.js
- dylricho.com/archive/gm965/convertClockToMHz.js
- dylricho.com/archive/gm965/convertClockToGHz.js
In the convertClockToMHz.js file, you can see that I’m currently listing each processor entry manually.
I know I could just continue to do it all manually, but the list is going to be rather large, and it’d be much better if it was with one line of code.
Thank you,
Dylan.
$('.clock').text() / 1000;does not do anything since you are not passing any argument totext()to update the DOM.Try this: