After clicking on an article link in my first html page, the URL of the second page looks like this:

localhost/basket/newstext.html?url=http://www.basket-planet.com/ru/news/9235

In JS, I'm trying to get the url=... and do something with it. Here's what I have for the scripts:

page2.html:

<body>
<div data-role="page" id="newstext">
<div data-role="content">
<div id="textcontent"></div>
</div>
</div>
<script src="js/newstext.js"></script>
</body>

newstext.js:

$('#newstext').bind('pageshow', function(event) {
var url = getUrlVars()["url"];
alert (url);
});

function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}

If you need to see my first page along with js and php file, let me know. Strange thing is I had it working before and now...I don't know what happened. I tried placing the script between the head tags, doesn't work. What's wrong here?