Search engine bots (google, facebook, etc) usually do not allow javascript when they scrape/crawl a url in order to create a preview (with title, description and an image).