Posts Tagged ‘javascript’

Debugging JavaScript the easy way

By David Pratt / Tags: , / 1 Comment » / Published: 21-11-09

A function that tests for the existence of the console.log method, and if it doesn’t exist, instead calls alert(). Handy when you’re testing in different browsers that don’t all have Firebug installed.

Notes about combining jQuery and Greasemonkey

By David Pratt / Tags: , , / 1 Comment » / Published: 05-11-09

Greasemonkey doesn’t inherit the jQuery library if it is just loaded onto the web page as normal. To use jQuery methods from GreaseMonkey code, you need to do this bit of coding magic…

Defensive coding in JavaScript with Namespacing

By David Pratt / Tags: , , / 2 Comments » / Published: 02-10-09

A tutorial on how to go about namespacing your JavaScript, plus a list of some of the benefits that you get from doing so.

You should probably put that in a function…

By David Pratt / Tags: , / No Comments » / Published: 14-09-09

A few pointers on making your JavaScript code more readable, amongst other things.