util.roundNumber = function(num, factor, type) {
    var roundTypes = {
        normal: 'round',
...

JavaScript On Rounding in JS

by paul.wilkins.myopenid.com, December 18, 2011 02:02

After writing some unit tes...

Aacfa176a8d73ca75b90b6375151765a Talk
util.roundNumber = function(num, factor, type) {
    var roundTypes = {
        normal: 'round',
...

JavaScript On Rounding in JS

by paul.wilkins.myopenid.com, December 18, 2011 02:01

After writing some unit tes...

Aacfa176a8d73ca75b90b6375151765a Talk
jQuery(function ($) {
  $('a[id^="li-div"]').click(function () {
    $('#' + this.id.substring(3)).slideToggle();
...

JavaScript On Toggle a few divs

by paul.wilkins.myopenid.com, December 06, 2010 11:02 Star_fullStar_fullStar_full

You can use the attribute-s...

Aacfa176a8d73ca75b90b6375151765a Talk
(function () {
    function addHeading(obj) {
        var objType, h2, text;
...

JavaScript On console.log for ie

by paul.wilkins.myopenid.com, August 21, 2010 00:16 Star_fullStar_fullStar_fullStar_full

The major change here is re...

Aacfa176a8d73ca75b90b6375151765a Talk
function _initCountUpUsers()
{
    var totalUsers, ceiling, floot, update;
...

JavaScript On Javascript Loop Refactor

by paul.wilkins.myopenid.com, August 03, 2010 03:18

You can use clearInterval f...

Aacfa176a8d73ca75b90b6375151765a Talk
function AddCommas(value) {
    var match = /^(\d+)(\d{3}[\.]?.*)$/.exec(value.replace(/,/g, ''));
    if (match) {
...

JavaScript On Format Numbers With Commas

by paul.wilkins.myopenid.com, June 10, 2010 02:59

The addCommas should be Add...

Aacfa176a8d73ca75b90b6375151765a Talk
function AddCommas(value) {
    var match = /^(\d+)(\d{3}[\.]?.*)$/.exec(value.replace(/,/g, ''));
    if (match) {
...

JavaScript On Format Numbers With Commas

by paul.wilkins.myopenid.com, June 08, 2010 01:44 Star_fullStar_fullStar_fullStar_fullStar_full

Let's get functional on this.

Aacfa176a8d73ca75b90b6375151765a Talk
this.rotate = function (antiClockwise) {
  var dir = (antiClockwise) ? -1 : 1;
  temp_x = this.x;
...

JavaScript On Rotate co-ordinates

by paul.wilkins.myopenid.com, March 05, 2010 22:06 Star_fullStar_fullStar_fullStar_fullStar_full
Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On Rotate co-ordinates

by paul.wilkins.myopenid.com, March 05, 2010 22:04

duplicate post

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On filter selectbox with 3000+...

by paul.wilkins.myopenid.com, February 04, 2010 02:25

Not to step on your toes, b...

Aacfa176a8d73ca75b90b6375151765a Talk
function autogeneratepassword(params) {
    var passwd = '',
        length = params.pwlength,
...

JavaScript On Cpanel like password generator

by paul.wilkins.myopenid.com, January 15, 2010 01:39

Here's a further refinement

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On timer.class

by paul.wilkins.myopenid.com, January 01, 2010 23:37

An example usage within the...

Aacfa176a8d73ca75b90b6375151765a Talk
var fields = ['invoice_discount', 'invoice_vat', 'invoice_salestax', 'invoice_freight'],
    i,
    field;
...

JavaScript On Need help with creating a loop

by paul.wilkins.myopenid.com, November 01, 2009 19:54 Star_fullStar_full

Edit: using a normal for lo...

Aacfa176a8d73ca75b90b6375151765a Talk
fireEvent: function(event) {
    var type = event.type;
    if (!this.events) return;
...

JavaScript On Error on closure

by paul.wilkins.myopenid.com, September 08, 2009 15:04

When the timeout runs the h...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On Error on closure

by paul.wilkins.myopenid.com, September 08, 2009 15:02

[deleted]

Aacfa176a8d73ca75b90b6375151765a Talk
$(function () {
    $('.toggle')
        .each(function () {
...

JavaScript On Better way in Prototype.js?

by paul.wilkins.myopenid.com, September 01, 2009 14:49

This question has been lang...

Aacfa176a8d73ca75b90b6375151765a Talk
var total = 0;
// For each fieldpair that has a child with a checked input
// we get the sibling with a text input and add that value
...

JavaScript On Port Prototype Code to jQuery?

by paul.wilkins.myopenid.com, September 01, 2009 13:21

The following seems to prov...

Aacfa176a8d73ca75b90b6375151765a Talk
var total = 0;
// For each fieldpair that has a child with a checked input
// we get the sibling with a text input and add that value
...

JavaScript On Port Prototype Code to jQuery?

by paul.wilkins.myopenid.com, September 01, 2009 13:10

The following is a working ...

Aacfa176a8d73ca75b90b6375151765a Talk
$('<select>...</select>')
    .click(function () {...})
    .wrap('<li></li>')
...

JavaScript On jQuery traversing

by paul.wilkins.myopenid.com, August 19, 2009 12:55

* Start from the content th...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On An incrementor function tha...

by paul.wilkins.myopenid.com, June 14, 2009 00:08

Some good ways to refactor ...

Aacfa176a8d73ca75b90b6375151765a Talk
$(document).ready(function(){
    var tabContainers = $('div.tabs > div');
    function hideSections() {
...

JavaScript On There must be a better way ...

by paul.wilkins.myopenid.com, May 21, 2009 07:32

Here is a way to improve th...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On There must be a better way ...

by paul.wilkins.myopenid.com, May 18, 2009 06:58

You could use a function th...

Aacfa176a8d73ca75b90b6375151765a Talk
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />

JavaScript On META tag info

by paul.wilkins.myopenid.com, April 15, 2009 07:13

Double quotes are the more ...

Aacfa176a8d73ca75b90b6375151765a Talk
function helperText($el) {
    $el.observe('click', function(event) {
        var element = event.element();
...

JavaScript On Prototype form functions

by paul.wilkins.myopenid.com, March 27, 2009 02:57

Each form element retains t...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On Range

by paul.wilkins.myopenid.com, March 18, 2009 00:35

And don't forget to initial...

Aacfa176a8d73ca75b90b6375151765a Talk