Retrieving a request parameter from a URL in which inturn has a URL with request parameters

I have the following URL

http://somesite/somepage.aspx

I am passing the value of a request parameter that has a different url with such request parameters.

http: //somesite/somepage.aspx? pageURL = http: //someothersite/someotherpage.aspx? param1 = value & source = http: // anotheronesite / anotherpage

I need the pageURL value to be in bold. But I get

http://someothersite/someotherpage.aspx?param1=value

and I do not get the original parameter. I am using the following JavaScript function -

  function getParameterByName( name )
  {
     name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
     var regexS = "[\\?&]"+name+"=([^&#]*)";
     var regex = new RegExp( regexS );
     var results = regex.exec( window.location.href );
     if( results == null )
       return "";
     else
       return decodeURIComponent(results[1].replace(/\+/g, " "));
  }

Any ideas?

+5
source share
2 answers

URL. & " URL".

+2

html url, pageURL?

.

0

All Articles