JavaScript/JQuery how can I get id of the caller to the new view

I have two links and both links redirect to the same new url (View) .

But depending on which href link was clicked, I need to show or hide buttons on the new view.

My question is there a way to know the id of the event/caller that redirected to current/new view?

I tried looking into jquery history method but wasn’t successful.

Thank you