Skip to content

Error "document.body is null" when loading script #11

@pianomansam

Description

@pianomansam

Even before I add any states, simply loading ssm.js gives me this error. Error is from getWidth() (line 173) where document.body.clientWidth is tested to be a number. The issue results from line 244 calling this method as the SSM object is created, and the SSM object is created before the document is ready so document.body.clientWidth isn't available yet. Simply commenting out line 244 and letting the ready method assign browserWidth seems to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions