I have a static session ID i'm using and need to add it to a url when clicked, but can't seem to get it right. If you go to http://www.mysite.com/test.php you get redirected, the session id XYX needs to be added, so the correct url to hit the page would be http://www.mysite.com/test.php?sessionid=XYX
<a href="http://www.mysite.com/test.php" class="foo">link here</a>
$('.foo').click(function(){
(this).append(?sessionid=XYX');'
});
I know this is wrong, all documentation Ive found is much more complex than my needs. thanks!
This should add the session ID and send the user to the new url, use the e.preventDefault to stop the system using the normal event, then add the session id to the url and send the browser there:
<a href="http://www.mysite.com/test.php" class="foo">link here</a>
$('.foo').click(function(e)
{
e.preventDefault();
window.location = $(this).attr('href') + '?sessionid=XYX';
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With