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

Probably does not need to d...

098e5c1a565b47e9860539fbebc3fa98 Talk
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...

543d0222ea3269453527c07141d48e4b Talk
(function(){

...

JavaScript On Expanding input list using ...

by Rene Saarsoo, January 15, 2009 22:43 Star_fullStar_fullStar_fullStar_fullStar_full

Divided it into group of na...

D41d8cd98f00b204e9800998ecf8427e Talk
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...

F55e8e113669f6ea7d1d99f38907ce54 Talk

JavaScript On countdown timer (minutes &a...

by seaofclouds, January 02, 2009 21:54

@some - real nice solution....

F55e8e113669f6ea7d1d99f38907ce54 Talk
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 dd, December 26, 2008 16:39
D2d66ecf0167dad4dda98a05cb6dee66 Talk
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...

87592c76b8b913ea464a1546aeb011d5 Talk
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:37

Adam - nice.

87592c76b8b913ea464a1546aeb011d5 Talk

JavaScript On ImageFlow - something like ...

by Stephen, December 23, 2008 20:02

Do you think it would be po...

1c7b2db5b23ca735680eaee72ab5fd6b Talk
function BusinessHour(t) {
    this.inRange = function() {
        return t > 0 && t < 14;
...

JavaScript On Writing a loop to create a ...

by Adam, December 11, 2008 19:37

Just playin' around.

A8d3f35baafdaea851914b17dae9e1fc Talk
times = [
  null,
  '7:00AM ',
...

JavaScript On Writing a loop to create a ...

by Tien Dung, December 11, 2008 08:35 Star_fullStar_fullStar_fullStar_fullStar_full
5071c5b861341c0dcfcf6ac86327701f Talk
function countdown(remain,messages) {
	var
		notifier = document.getElementById("notifier"),
...

JavaScript On countdown timer (minutes &a...

by some, November 17, 2008 11:06 Star_fullStar_fullStar_fullStar_full

I like Tien Dungs approach ...

Ae5de8fa45f79815c64b98690088a48d Talk
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...

64a1736c4d99161054707a2a1393223b Talk

JavaScript On Highlight Selected forms, S...

by openid.aol.com/forwardfootmedia, October 14, 2008 19:39

I like the naming of formDe...

Fbb264f64b4ce69bae04764280141faf Talk
FormDefault = {
    setHighlight: function(object) {
        var element = FormDefault.element(object);
...

JavaScript On Highlight Selected forms, S...

by Adam, October 14, 2008 19:12 Star_fullStar_fullStar_fullStar_full

Prototype version based on ...

A8d3f35baafdaea851914b17dae9e1fc Talk

JavaScript On Highlight Selected forms, S...

by John Sietsma, October 12, 2008 03:09 Star_fullStar_fullStar_fullStar_full

No really, I suppose just b...

37ce1520d319fa8095d05aa475951616 Talk

JavaScript On Highlight Selected forms, S...

by openid.aol.com/forwardfootmedia, October 11, 2008 20:41

29 lines over 90, Not bad. ...

Fbb264f64b4ce69bae04764280141faf Talk
$.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 ...

37ce1520d319fa8095d05aa475951616 Talk
loadURL(location.hash || "#news")

JavaScript On Small Javascript Code

by Adam, October 08, 2008 03:59 Star_fullStar_fullStar_fullStar_fullStar_full

No need to split up the loc...

A8d3f35baafdaea851914b17dae9e1fc Talk
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 Star_fullStar_fullStar_fullStar_fullStar_full

You can't do ||= in JavaScript

5071c5b861341c0dcfcf6ac86327701f Talk
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 Star_fullStar_fullStar_fullStar_full

Use true/false instead of u...

5071c5b861341c0dcfcf6ac86327701f Talk
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...

035687df00d162cec025302373ebc076 Talk
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....

3c2a50916630af4097799a1fd2b1ebce Talk
// 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];
...

JavaScript On Small Javascript Code

by Tien Dung, October 06, 2008 04:21 Star_fullStar_fullStar_fullStar_full
5071c5b861341c0dcfcf6ac86327701f Talk
/*

var biz;
...

JavaScript On Small Javascript Code

by chovy.myopenid.com, October 06, 2008 02:05 Star_fullStar_fullStar_fullStar_full

Get position of "#" in the ...

035687df00d162cec025302373ebc076 Talk