Trouble with query string when parsing on mobile blog template


Here is the scene :
I’ve some link on below post( Let href value be:

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:

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

Everything is working good when using it on desktop but when using it on mobile it redirect like :“”

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

the code on my blog page( where it parses the url :

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

   var href = document.location.href;
   var link = href.split('?')[1];
  //add event listener
  myBtn.addEventListener('click', function(event) {


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