Getting the urls params in a page using jquery [duplicate]
Possible Duplicate:
Get QueryString values in Javascript
Hey all,
ive read and read and i feel im missing something so im going to ask.
what im trying to do:
get the url params from page using jquery.
function findIt() {
$.ajax({
url: "${开发者_如何学JAVAurl.context}/itemlist/getitemlist",
params: "foobar",
context: document.body,
success: function (data) {
$('#results').html(data);
}
});
};
the url in which im sending the params to is where i need to grab the parameters using jquery.
e.g. in Php:
$foo = $_GET['name']
in jquery?????
i know this has to be simple, but im lost. any help would be appreciated.
See How can I get query string values in JavaScript? for tons of possible solutions.
精彩评论