Hi Simon,
I'd recommend using http://jquery.com/api/ and firebug to help you debug. You're function looks ok, but I think error is an object that contains lots of data. Check out $.ajaxError at the api I linked. Let me know if you have more questions. ~Sean