How to grab Query String and Send it to Ajax in jQuery

I had a peculiar requirement where I had to grab the entire query string (GET parameters) from the current page and send it to the ajax call happening on the same page.

Here is how I did that

    url: "/your/ajax/url",
    dataType: "json",
    async: false,
    success: function (data) { 

With, you get the entire query string from the current page. I am then appending it to the ajax URL to send the parameters as a GET request.

Site Footer