updated for jquery >= 2.1 and node >= 0.10