image for site

Why Assets Can't Be Called from script.js in Zendesk

Understand why assets can't be called from script.js in Zendesk and how to correctly access them from the template.

Why can't I call assets from script.js in Zendesk?

In Zendesk, assets cannot be called from the script.js file because they need to be accessed directly from the template itself.

If you're trying to dynamically change the logo based on URL parameters, you should move the function into a script tag within the header template. This ensures that the assets are correctly processed and displayed. For more guidance, refer to the documentation or seek advice from the Zendesk community.


More related questions

How can I change the logo return URL in my Zendesk Help Center?

To change the logo return URL in your Zendesk Help Center, you need to edit the HTML in your theme. By default, clicking the logo image takes users to the home page, but you can customize this to redirect to a different URL. First, upload your logo…

What steps are involved in updating the logo URL in Zendesk?

Updating the logo URL in Zendesk involves a few key steps. First, upload your logo image to the Assets area and make a note of its URL. Then, access the Customize design section, click on Edit code, and select header.hbs from the templates list….

Yes, you can change the alt text for the Help Center logo in Zendesk. To do this, you need to modify the HTML code in your theme. Locate the logo div tag in the header.hbs template and update the alt attribute within the img tag. You can use the…

How do I find the correct path-to-image after uploading to assets?

To find the correct path-to-image after uploading to assets in Zendesk, you need to access the Assets area where your image is stored. Once you've uploaded your image, make a note of its URL. This URL will be used in the HTML code to specify the…

Interested indeflectingover 70% of your Zendesk support tickets?

Our AI customer support agent is here to help. Trained on all your help docs, installed directly into your Zendesk account, it can be used to automate customer replies for tickets or live chat. Learn more below.
Zendesk logo

Zendesk Support Tickets

Receive new tickets by email or a support form? This integration is for you.
My AskAI integrated within Zendesk to deflect support tickets
Learn about our Zendesk ticket integration
Zendesk logo

Zendesk Messaging (live chat)

Using Zendesk's Messaging widget on your site for live chat? This integration is for you.
My AskAI integrated within Zendesk to deflect customer support live chat conversations
Learn about our Zendesk Messaging integration

Join1,000+ companies reducing their support costs and freeing up support agents for more important work

Vestd company logo — Customer of My AskAI's AI customer support agents
Genesis company logo — Customer of My AskAI's AI customer support agents
Zinc company logo — Customer of My AskAI's AI customer support agents
Customer.io company logo — Customer of My AskAI's AI customer support agents
Zeffy company logo — Customer of My AskAI's AI customer support agents
NHS company logo — Customer of My AskAI's AI customer support agents
Kontakt.io company logo — Customer of My AskAI's AI customer support agents

Reduce support costs.Spend more time on customer success.

Our AI customer support agents are already used by 👇
Companies using AI assistants on their websites