You are calling a function from a href (which you shouldn’t do, but that’s another issue) and the function call appears to have a query string appended to it which is not allowed.
window.open can take query strings, but what you’re doing there is… something altogether different, and using a function that you havent shown us. As webdev said, this shouldnt be inside the href attribute (rather, it should be in the onClick attribute)
Most JavaScript will not work properly if incorrectly included in an href attribute.
JavaScript certainly isn’t going to work if you stick a ?id on the end of the script as >id is not valid JavaScript.
You ought to be attaching the script via the click event and adding the id to the url you send to location.href within the JavasScript function itself.
The href attribute should contain a link to where you want those people without JavaScript to go when they click the link.