I would like to use a library like jQuery or YUI in my controller scripts. However, when I try to import these libraries there are always some errors, because they expect to be in a browser environment, using objects such as "document" or "window".
Is there anyway around this?