I have a page that I am working on that is mainly asynchronous. I want to append a variable at the end of my url when the user clicks a row.
Ie.
1. URL: asr-web-dev1:8881/?s=101-01
2. user clicks on a row
3. URL: asr-web-dev1:8881/?s=101-01&id=153474
EDIT: I don't know how to do this. My code that I have does not work. The page is in PHP.
Here is my jQuery:
$('#searchTable tr').click(function(){
var parcel_id = $(this).attr('id');
$(this).attr('href', window.location.href + '&id' + parcel_id);
/*$.ajax({
url: "classes/get-apn.php",
//timeout: 30000,
type: "GET",
data: { 'parcel_id': parcel_id },
dataType: 'json',
error: function(SMLHttpRequest, textStatus, errorThrown){
alert("An error has occurred making the request: " + errorThrown)
},
success: function(data){
//do stuff here on success
}
});*/
});
Thank you for your help! :)