Getting the request parameters inside page fragments, loaded with jQuery load()?

94 Views Asked by At

I have a web-application with a main menu, which loads all pages inside a div, located in my main.html. I load the pages with jQuery .load() like this:

$(".main-content-container").load("view-user.html?id=123 .sub-content-container");

I would like inside the loaded page fragment (view-user.html) to be able to get the request parameters (id=123 in this case) in order to be able to fill the form with the data for the user with the given ID. If I use window.location.href though I receive not view-user.html?id=123, but main.html instead, which is expected actually, since that is what is shown all the time in browser's address bar. So, the question is: is there a way to obtain the request parameters inside the page fragment when loading it?

0

There are 0 best solutions below