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