jquery and javascript practices