Trouble with query string when parsing on mobile blog template


#1

Here is the scene :
I’ve some link on below post( Let href value be: mysite.com) www.example.blogspot.com/10/2015/post.html

when user click on that link, he is redirected to my blogger page where i’ve put on some messages to show then a button available there to continue. The URl goes like: www.example.blogspot.com/p/donate.html?mysite.com

with help of javascript it split the url after “?” when user click on continue, it redirects him to : "mysite.com"

Everything is working good when using it on desktop but when using it on mobile it redirect like :“mysite.com%26m%3D0”

its like ?m=0 mobile template . I’m using custom blogger template on my blog.

the code on my blog page(www.example.blogspot.com/p/donate.html) where it parses the url :

 <body> 
    <form action="">
         <input type="button" id="myButton" value="continue"/>
    </form> 

<script>
 
   var href = document.location.href;
   var link = href.split('?')[1];
  //add event listener
  myBtn.addEventListener('click', function(event) {
    window.location.href="http://"+link;
  });
</script>


 </body>

Please suggest me some better option if available .Thank you all…!!! @Mohammad