I have got a page called servicesDetails.html that has links.The url looks like below
../Myapp/servicesDetails.html?servicetype=Advanced&serviceid=1208
The links when clicked loads an internal page called audioListPage with some params,the link looks like this
<a href="#audioListPage?audioid=123&audiotype=mp3" class="loadAudio" data-role="button" data-mini="true" data-inline="true">
Once the audioListPage is loaded the url changes to
../Myapp/servicesDetails.html?servicetype=Advanced&serviceid=1208#audioListPage?audioid=123&audiotype=mp3
I need to display the user with the audioid and audiotype when the audioListPage loads,how do i do this?
Based on a comment below I tried this
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
$('#audioListPage').live('pagecreate',function(event) {
console.log($.urlParam('audioid '));//this is giving me an error
});
I checked why the error was occuring and found that window.location.href is giving me only ../Myapp/servicesDetails.html?servicetype=Advanced&serviceid=1208, not the updated URL.Im not sure if Im calling the $.urlParam() at the right event