$(document) && $(window) supported, but with bugs