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($)
These are all misleading, you never want to add to the browser history unless you want to go to a different page in a single page app. If you want to remove the parameters without a change in the page, you must use:
window.history.replaceState(null, null, window.location.pathname);