cherry pick from Master: Fixed a possible issue with $ not being set for jquery