Error-Event logging

Error-Event logging

Hey all

i wrote sth like this
  1.         $(window).error(function(msg, url, line){
                jQuery.post("jLogging.php", { message: msg, link: url, line: line });
            });

to send the errors to my php script. it's also mentioned as an example in the jquery api-browser, http://view.jquery.com/trunk/tools/api-browser/#link-error-fn

but it doesn't work and i get this error message in FF:

Fehler: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object"  nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"  location: "JS frame :: file:///C:/_WebServer/htdocs/jquery-1.4.2.js :: add :: line 5437"  data: no] 

so i looked here http://api.jquery.com/error/ and in the comments they say the parameters are gone!?
why? what is my error about? :/