are you testing in preview mode?
the window object is different in preview and edit mode because the script is executed in different contexts.
are you testing in preview mode?
the window object is different in preview and edit mode because the script is executed in different contexts.