Store numeric value as variable

Influex

New Member
I have a link that redirects the user to admin of a page and adds \[code\]?delete=\[/code\] with a number at the end, for example: \[code\]?delete=1\[/code\].On the page that it redirects to, I want jQuery to find the id with the numeric value, in the examples 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:\[code\]var exampleid = 1; (the end number on the URL)$('body').find('#' + example).addClass('selected');\[/code\]I know that I could use \[code\]window.location.pathname\[/code\] but it'll store \[code\]?delete=\[/code\] as well as the number when I only the numeric value.
 
Back
Top