make sure window is not escaped in JQuery (closes #2139)