I am using jquery, jquery mobile and html to build a mobile app using phonegap, my index.html display a list of names
<li><a href="profile.html?id='+item.id+'"><h3>'+item.fname+' '+item.lname+'</h3></a></li>
When user click on any person of list, the profile of that person should be displayed, I need to get the current url (profile.html?id=) to extract the id of the person, to make the database query.
I tried to use ( inside the body of profile.html)
<script>
url=window.location.href;
<script>
and
<script>
url=document.URL;
</script>
but both return the url of the index.html not the second page (profile.html?id=), even though the URL of page is changed to profile.html?id=2 when I tested on browser any idea?