Created
January 14, 2011 10:17
-
-
Save jimmiw/779444 to your computer and use it in GitHub Desktop.
Revisions
-
jimmiw created this gist
Jan 14, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ /** * Gå ind på mit bibob, vælg "Mit forbrug", skriv din periode, åben firebug, * og brug konsollen og kopier følgende kode stump ind. Så kan du se hvor * meget data du har brugt for den valgte periode. */ var total = 0; $('#table_0 table .usageCell5subsub nobr').each(function() { total += Number($(this).text().split(' ')[0]); }) // tests if the usage should be displayed in MB or KB if(total>1024) { total = (total/1024).toFixed(2) + ' MB'; } else { total = total.toFixed(2) + ' KB'; } // finds the cell to display the data in var cell = $('#usageTable .usageItemTr:first .usageCell4'); // gets the current text var cellText = $(cell).text(); // inserts the "usage" text in the price cell. $(cell).text(cellText + ' forbrug: '+total);