i am trying to get the value attached in the url using jquery mobile.
http://localhost/testing/nothing.html#details?id=0&color=blue
I want to get the id = 0 and color = blue using jquery mobile when i go to the "details" page:
$('#details').live('pagecreate',function(event)
{
});
Thanks.
Please check this link
Write the fucnction like shown below
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
To get a particular value just call the function and pass the name of the parameter
$.urlParam('id');