title: How to pass a web address in window.location.href as a parameter
body: <p>I am using <strong>window.location.href</strong> to redirect a page in which i am sending website address as a parameter like,</p>
  
  <pre><code>var page_name='http://www.google.com';
  window.location.href="edit-user-profile_2.php?uid="+userID+"&amp;page_name="+page_name;
  </code></pre>
  
  <p>When i executed the script then its goes on a forbidden page.I am attaching snapshot.</p>
  
  <p><img src="https://i.stack.imgur.com/h19sa.png" alt="enter image description here"></p>
  
  <p>I have also tried with <strong><em>encodeURI(var)</em></strong>, but its not working,is there any function in java-script to solve this issue ?</p>