Sorry I'm new in Javascript. I wanna get a number from my url in javascript, because I need it very much. I'd got this code from another link but it's not perfect enough for my case. The code is like this:
<html>
<head>
<style>
</style>
<script type="text/javascript">
function kampret(){
x=location.pathname.split('/')[1];
alert(x);
}
</script>
</head>
<body onload='kampret()'>
</body>
</html>
My url is like this:
http://domain.com/ztest1.php?ai=85&ver=7
I want to get that number of '85', and i used that code and the result is ztest1.php not 85. And how do i get the only 85? Thank you.