I have a link that redirects the user to the admin of a page and adds ?delete=
with a number at the end, for example: ?delete=1
.
On the page that it redirects to, I want jQuery to find the id with the numeric value, in this case 1, and then execute a function.
I thought it'd be best to store the numeric value as a variable, because it'd be easier to execute, but I don't know how to do that.
The number is different so I can't just add that number.
I wanted to do:
var exampleid = 1; (the end number on the URL)
$('body').find('#' + example).addClass('selected');
I know that I could use window.location.pathname
, but it'll store ?delete=
as well as the number when I only need the numeric value.