Uncaught ReferenceError: function is not defined with onclick

Never use .onclick(), or similar attributes from a userscript! (It’s also poor practice in a regular web page). The reason is that userscripts operate in a sandbox (“isolated world”), and onclick operates in the target-page scope and cannot see any functions your script creates. Always use addEventListener()Doc (or an equivalent library function, like jQuery .on()). … Read more

How can I use jQuery in Greasemonkey scripts in Google Chrome?

From “User Script Tip: Using jQuery – Erik Vold’s Blog” // ==UserScript== // @name jQuery For Chrome (A Cross Browser Example) // @namespace jQueryForChromeExample // @include * // @author Erik Vergobbi Vold & Tyler G. Hicks-Wright // @description This userscript is meant to be an example on how to use jQuery in a userscript on … Read more