Welcome to Code Couch

Posts in the JavaScript category

  • Replacement for “bind” or “bindAsEventListener” in jQuery

    Do you need to use the equivalent of Prototype's "bind" or "bindAsEventListener" in jQuery, passing through "this" context? Read on for more!

  • Spell checking in Firefox

    Want to know how to spell check an entire web page in Firefox? Or how to add spell-checking to fields that do not have it by default? Read on for more.

  • Enabling cross-site scripting XSS via an iframe

    Communication from an iframe that has content from a domain other than the one the iframe is contained within is a constant source of frustration - as browsers prevent this kind of activity due to built-in security policies. Here is a technique to perform cross-site scripting (XSS) in just such an environment with example code and a real-world example.

  • ReferenceError: console is not defined

    If you have recently upgraded to the free Firefox extension Firebug 1.2 - then you may have experienced some difficulties with console.log throwing the following: ReferenceError: console is not defined. Read on for an explaination...

  • Tips on converting strings into numbers

    I recently ran into some strange behaviour using parseInt() to convert a string into an integer. It turns out that passing in the base (radix) of the number that the string prepresents is important to ensure the desired behaviour.

  • What is Javascript?

    JavaScript is an object-based scripting programming language based on the concept of prototypes. The language is best known for its use in websites, but is also used to enable scripting access to objects embedded in other applications.