I need to pass data from one click events. I am building a menu that pulls data on the links a user successively clicks. The first link would be like this:
?type=1
I need to then get that to a link that is:
?level=2
so that the data query is:
?type=1&level=2
The thing is the code needs to dynamically determine the query for the second click, which might or might not be the last query above. The query won't be determined until the user clicks, which needs to return a query string like the above on the second click.
So I have two click handlers:
btn1.on('click', function() {
// get value of "type" from query string through some regex. This works.
}
btn2.on('click', function() {
// get value of "level" via regex. This works.
// get value of type from btn1.click and add to query
// submit query ?type=___&level=____
}
How do I do this? I tried using .bind but couldn't get it working.