With Guide Templating V2, you'll need to import a jQuery library if you want to use jQuery statements in a theme in place of vanilla JavaScript.
This guidance is for instructional purposes only, and if you have any jQuery issues, see the official jQuery site.
To install or upgrade jQuery in your Help Center themes
- In Guide, click the Customize design icon () in the sidebar.
- From the theme you want to work with, click Customize.
- Click Edit code.
- Click document_head.hbs.
- Visit https://code.jquery.com and click on the minified version of the jQuery version you want to use.
- Paste the
script
tag into your HTML file. Example:<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"> </script>
The
integrity
value will vary. The attribute lets browsers know that the resources hosted on the third-party server have not been tampered with.
The jQuery library is loaded, and you can include jQuery statements in your Help Center themes.
2 comments
Brad Allen
Two questions related to this.
1 - what version of jquery must be installed to use this code?
2 - does this just need to be added to the script.js file in templates or do i need some HTML in my new requests template as well?
0
Christopher Kennedy
Hi Bradley,
You can use the version of jQuery that you'd like in your theme. That portion is totally within your control. Also, this article demonstrates loading jQuery from the document_head.hbs template. This template renders on all Help Center pages, so no need to duplicate that effort elsewhere.
Thanks,
0