View RSS Feed

JavaScript

  1. JQuery Plugin to include commas when formatting numbers

    by on April 7th, 2011 at 10:15 AM
    I wanted to be able to format numbers to include commas every 3 numbers and then fix them to a certain number of decimals. There are a few different format functions out there and also JQuery plugins, but couldn't seem to find one that did exactly what I wanted, so ended up writing my own.

    Here's the code for anyone else looking for something that will format numbers to include commas using JQuery:-
    Code:
    (function ($) {
        $.fn.formatNumber = function (seperator, every,
    
    ...
  2. Convert .asmx file to WCF .svc file to create simple API web service

    by on October 19th, 2009 at 10:50 PM
    1) Introduction

    This is part of a series of blogs. The others are:-
    2) A simple .asmx file and calling a function
    3) Converting a .asmx file to WCF .svc file


    I had some time on my hands recently and for one reason or another starting looking into web services and WCF. It was about a week ago and I can’t remember the exact reason why I started, but I thought I’d detail the pitfalls, hair pulling, shouting and swearing moments into a blog to help ...
  3. Preventing Form Submit with button element in Firefox

    by on March 11th, 2009 at 10:17 AM
    I had an issue in Firefox where I wanted a <button> element to fire a Javascript function onclick.

    However, I found in Firefox that the button also performed a submit on the form, which I didn't want.

    After a little investigation I discovered that the default type for a button element is submit. Apparently a bug in IE prevents it from firing.

    So, how to fix?

    Add a type="button" property to your <button> element
    ...

    Updated March 11th, 2009 at 10:19 AM by richyrich

    Categories
    Programming & Scripting , HTML/XHTML , Web Design , JavaScript

SEO by vBSEO