HorseAJ86 / node-jquery

jQuery with a thin wrapper for Ender.JS, Node.JS, and other npm-based packaging systems
http://jquery.com
MIT License
431 stars 66 forks source link

Conflict with html #46

Closed jamalsoueidan closed 11 years ago

jamalsoueidan commented 11 years ago

I'm getting this error

$(function() { ^ TypeError: Property '$' of object [object DOMWindow] is not a function

I cannot change the site sourcecode.

netroy commented 11 years ago

@jamalsoueidan in your node code, you can force window.$ to be jquery

var window = $('body')[0]._ownerDocument._parentWindow;
window._$ = window.$;
window.$ = $;

but do this only if your code is rather hack-ish & you don't intend to maintain it, since _ownerDocument._parentWindow is private & might change with jsdom versions.