title: How to get the redirected url in javascript
body: <pre><code>&lt;html&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  function change(){
      var clientID = "hgffgh";
      var clientSecret = "fgfhgfh";
      var callbackUri = "https://login.live.com/oauth20_desktop.srf";
  
      var tokenUri = "https://www.box.com/api/oauth2/token";
      var authUri = "https://www.box.com/api/oauth2/authorize?"+
              "client_id="+clientID+
              "&amp;response_type=code"+
              "&amp;redirect_uri="+callbackUri
  
      //var web = window.open(authUri);
      //console.log(web.location.href); 
  
      var win = window.open(authUri, "windowname1", 'width=800, height=600'); 
  
      //alert(win)
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>AuthUri opens a new window. In new window when I click on allow, I will be redirected to a new window, How to get the last redirected url ?</p>