i am trying to get the querystring value in jquery and pass it to php page using ajax. but i am getting the full string like task_id=2 instead i want only value 2. how can i do this?
$('#stop').click(function(){
var time = $('#counter').text();
var url = location.search.substr(1)
    $.ajax({
                type: "POST",
                url: "ajax-calls/updatetimestamp.php",
                data: {time,url}
                success: function() {
                    location.reload();
                },
            });
})
 
    