Remove extra-parameters; use test() instead of typecasting

Here are the changes

1. The self-invoking function was only expecting the `jQuery` parameter, but was receiving `window` and `document`.

2. Instead of typecasting the value to a string and using `match()` I thought it would be easier/better to use [`test()`][mdn_test]

[mdn_test]:https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/test