Replace jq by $
Remove trailing whitespaces
Fix js syntax errors, may breake IE