Currently working on something which uses ajax for some pagination. What I’m looking to do is add something like referal=3 to the end of some links then when they go to that link I’ll insert a back button with the window location for example:
User uses the ajax pagination, goes to page 3 I’ll add ?ref=3 to the end of the link or something so it would like this this:
http://foo.com/somepage/?ref=3
(not sure if that’s a corrent way of doing it)
Then the user clicks that link and I’ll append a back button on that page with that link.
So when they go back to the homepage using the generated button the window.location.href will be:
http://foo.com?ref=3
The idea is that when they click that back button, the ajax pagination will load to page 3.
I’m not sure how else to explain this, but does anyone know how I would go about doing a conditional statement dependant on the window.location.href?
To find a if the url contains some string: