Fix for BLD-993

In certain cases jQuery errors when it is passed an invalid
selector. A fix for this is to silently catch these errors.

Jasmine tests were added to prevent this bug in the future.

BLD-993
Merge pull request #3356 from edx/valera/l73a

Fix for BLD-993