This is for SharePoint Server 2016.
If it is for a particular list or library page, you could consider adding a Custom action button to the ribbon using SharePoint Designer 2013.
Otherwise if you still want to use JS, here's a snippet from one of the solutions I worked on:
workflowURL = siteRoot + "/_layouts/NintexWorkflow/StartWorkflow.aspx?List=" + listGUID + "&ID=" + goTo +"&WorkflowName=" + workflowName + "&Source=" + item; window.location.href = workflowURL;
NB: I'll assume you've enough JS experience to "fill in the blanks".