function formatCurrency(num) {
var stripped = num.toString().replace("$","").replace(",",""); // strip off the $ and thousands seperators
var n = (isNaN(stripped)) ? 0 : stripped*1; // coerce into a number, default to zero
...
JavaScript On Format Currency
by slf,
January 22, 2009 18:29
test("fractions", function() {
equals( formatCurrency(0), "$0.00" );
...
JavaScript On Format Currency
by Rene Saarsoo,
January 20, 2009 22:36
You sayd: "One of our requi...
(function(){
...
JavaScript On Expanding input list using ...
by Rene Saarsoo,
January 15, 2009 22:43
Divided it into group of na...
var countdown_d = new Date();
var countdown_timenow = countdown_d.getTime();
var countdown_targetdate = Date.parse("#{params[:year]}/#{params[:month]}/#{params[:day]} #{params[:hour]}:#{params[:minute]}")
...
JavaScript On countdown timer (minutes &a...
by seaofclouds,
January 03, 2009 04:24
alright, i've got it workin...
JavaScript On countdown timer (minutes &a...
by seaofclouds,
January 02, 2009 21:54
@some - real nice solution....
function PrintHour(hour) {
var o = hour + 5;
return ((o%12) + 1) + ":00" + (((o%23) - 10) > 0 ? "P" : "A") + "M";
...
function PrintHour(hour) {
var o = hour + 5;
return ((o%12) + 1) + ":00" + (((o%23) - 10) > 0 ? "P" : "A") + "M";
...
JavaScript On Writing a loop to create a ...
by Garren,
December 24, 2008 00:40
oops BusinessHour should be...
function PrintHour(hour) {
var o = hour + 5;
return ((o%12) + 1) + ":00" + (((o%23) - 10) > 0 ? "P" : "A") + "M";
...
JavaScript On ImageFlow - something like ...
by Stephen,
December 23, 2008 20:02
Do you think it would be po...
function countdown(remain,messages) {
var
notifier = document.getElementById("notifier"),
...
JavaScript On countdown timer (minutes &a...
by some,
November 17, 2008 11:06
I like Tien Dungs approach ...
x = new Array(); x[2] = 'something'; x[7] = 'somethingelse'; ...
JavaScript On Get the last key
by SEO Services,
November 08, 2008 01:42
Another thing you can do to...
JavaScript On Highlight Selected forms, S...
by openid.aol.com/forwardfootmedia,
October 14, 2008 19:39
I like the naming of formDe...
FormDefault = {
setHighlight: function(object) {
var element = FormDefault.element(object);
...
JavaScript On Highlight Selected forms, S...
by Adam,
October 14, 2008 19:12
Prototype version based on ...
JavaScript On Highlight Selected forms, S...
by John Sietsma,
October 12, 2008 03:09
No really, I suppose just b...
JavaScript On Highlight Selected forms, S...
by openid.aol.com/forwardfootmedia,
October 11, 2008 20:41
29 lines over 90, Not bad. ...
$.fn.setHighlight = function() {
return this.each( function() {
$(this).removeClass('optional');
...
JavaScript On Highlight Selected forms, S...
by John Sietsma,
October 11, 2008 04:51
I couldn't resist a JQuery ...
function getAnchor(default) {
default = default || 'news';
return document.location.toString().split( '#' )[1] || default;
...
JavaScript On Small Javascript Code
by Tien Dung,
October 06, 2008 22:23
You can't do ||= in JavaScript
Q("#toggler").click(function() {
var mode = this.mode;
this.mode = !mode;
...
JavaScript On Toggle "Check all / Un...
by Tien Dung,
October 06, 2008 22:19
Use true/false instead of u...
var getAnchor = function (default) {
default ||= 'news';
return document.location.toString().split( '#' )[1] || default;
...
JavaScript On Small Javascript Code
by chovy.myopenid.com,
October 06, 2008 19:46
Some would say you should o...
var selectedAnchorOr = function(url, default) {
var urlWithAnchor = url.match(/^.*(#.+)$/);
if (urlWithAnchor !== null) {
...
JavaScript On Small Javascript Code
by Gabriele Lana,
October 06, 2008 06:13
Not tested but should work....
// Don't know why you need hash > 0 and page.length > 1
// In case you don't need those conditions
var page = document.location.toString().split("#")[1];
...
/* var biz; ...
JavaScript On Small Javascript Code
by chovy.myopenid.com,
October 06, 2008 02:05
Get position of "#" in the ...

Probably does not need to d...