Hi Nik

Lorem Ipsum


Test Blog

This is just a test blog.

Firefox exception ‘JavaScript component does not have a method named: “available”’

“[Exception… \”‘JavaScript component does not have a method named: \”available\”‘ when calling method: [nsIInputStream::available]\”  nsresult: \”0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)\”  location: \”JS frame :: https://localhost/vendor/jam/jquery/jquery.js :: .send :: line 2\”  data: no]”

Solution: http://stackoverflow.com/a/15844406

Convert object to string JSON.stringify(formData)

Get the previous selected value after a dropdown is changed

(function () {
    var previous;

    $("select[name=test]").focus(function () {
        // Store the current value on focus, before it changes
        previous = this.value;
    }).change(function() {
        // Do soomething with the previous value after the change
        document.getElementById("log").innerHTML = "<b>Previous: </b>"+previous;

        previous = this.value;

        // Unselect dropdown - optional

Select deselect radio button

var thisEl = $(e.currentTarget),
    previousValue = $(e.currentTarget).attr('previousValue'),
    name = $(e.currentTarget).attr('name');

if (previousValue === 'checked') {
    thisEl.attr('previousValue', false);
} else {
    $('input[name="+name+"]:radio').attr('previousValue', false);
    thisEl.attr('previousValue', 'checked');