Fixes #13566. If there is a window object, define jQuery and $

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Fixes #13566. If there is a window object, and it has a document property, it might be the window we want, so define jQuery and $. Thanks to @dcherman for saving us from that embarrassment!

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>