Skip to content

Instantly share code, notes, and snippets.

@Sarapulov
Created June 8, 2017 08:27
Show Gist options
  • Save Sarapulov/1fc0a444558a5a9abd0854ce9eec7c29 to your computer and use it in GitHub Desktop.
Save Sarapulov/1fc0a444558a5a9abd0854ce9eec7c29 to your computer and use it in GitHub Desktop.
Zendesk Help Center redirect after page is loaded
<script type="text/javascript">
$(document).ready(function() {
(function(f, l, lh, isR){ // redirect to ticket form page if not already form page, requests page or article page
f = 151485, l = window.location, lh = l.href, isR = !(l.search.match("ticket_form_id") || lh.indexOf('/requests') > -1 || lh.indexOf('/articles') > -1),
hc = HelpCenter, isU = hc && (hc.user.role !== 'manager' && hc.user.role !== 'agent');
if (isR && isU) l.replace("/hc/"+document.getElementsByTagName("html")[0].lang.toLowerCase()+"/requests/new?ticket_form_id="+f);
})();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment