I am trying to remove everything after the \"?\" in the browser url on document ready.
Here is what I am trying:
jQuery(document).ready(function($)
Here is an ES6 one liner which preserves the location hash and does not pollute browser history by using replaceState:
replaceState
(l=>{window.history.replaceState({},'',l.pathname+l.hash)})(location)