I want to pass two url parameter to a page but its only able to pass the first you URL. Here's an example html users?user_id=9&username=john
, with this example the script only passes the first one parameter which is 9
. I get it in an alert "9&username="
without showing the value of the username
$(document).ready(function () {
$('.usersclick').on('click', function (event) {
$('#users').empty();
var href = $(this).attr('href'); // Get the `href` value of the clicked anchor
var paramValue = href.split('=')[1]; // Get the value after =
$('#news_container').load('http:users?user_id='+paramValue);
alert (paramValue)