When writing JavaScript code for the browser, it is useful to tell JSLint that you are in browser mode, for example by enabling this:
/*jslint browser: true */
This should allow "document", "setTimeout" and other standard browser settings.
Since jQuery is probably not evaluated in the same context as your JavaScript, you need to report that the always useful "$" is available with
source share