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 #3354 from edx/valera/l63b

Fix for BLD-993