I'm dynamically loading my views with ajax using:
view = getUrlParameter('view') ? getUrlParameter('view') : window.location.href+="?view=newusers";
$.ajax({
method: "post",
url: "views/empregador/" + view + ".php",
data: {
auth: 'ajaxrequest'
}
}).done(function(data) {
$('#viewa').html(data);
});
This works perfectly for cases where you access a page that does not need GET parameters. However, in some requests I need to have my url be "views/empregador/" + view + ".php?meuGet=123&meuOutroGetAleatorio=123&..."
.
My getUrlParameter function retrieves URL-specific parameters, forcing a check if 1 by 1 exists, which would be totally impractical for the level of application complexity.
Is there a method of dynamically capturing all GETs passed by the URL with javascript?