Refer:
decodeuricomponent[
^]
+++++++++++++ part 2 +++++++++++++
page1.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Page 1</title>
<script>
function myFunction(){
var query="page2.html?vechicleid=1234&prev_url="+location.href;
window.location = query;
}
</script>
</head>
<body>
<button type='button' onClick="myFunction();">Click me</button>
</body>
</html>
page2.html
<!DOCTYPE html>
<html>
<head>
<title>Page 2</title>
</head>
<body>
<script>
var queryString = decodeURIComponent(window.location.search);
queryString = queryString.substring(1);
var queries = queryString.split("&");
for (var i = 0; i < queries.length; i++)
{
document.write(queries[i] + "<br>");
}
</script>
</body>
</html>