title: get iframe redirection url in javascript
body: <p>i am doing an iframe request to a page on my backend server. the page does a redirect and returns the same url as that which is requested but also appends a query string. how can i get the returned url and query string? my ajax class looks like this:</p>
  
  <pre><code>var ajax =
  {
    send: function(urlstring)
    {
      if(!this.ifram)
      {
       this.ifram = document.createElement('iframe');
       this.ifram.style.display = 'none';
       if(this.ifram.addEventListener) this.ifram.addEventListener('load',ajax.receive,false);
       else if(this.ifram.attachEvent) this.ifram.attachEvent('onload',ajax.receive);
       document.body.appendChild(this.ifram);
      }
      this.ifram.setAttribute('src',urlstring);
    },
    receive: function()
    {
       content = ajax.ifram.contentWindow.document.body.innerHTML;
       returnurl = ajax.ifram.src;
       alert('return url: '+returnurl);
    }
  };
  </code></pre>
  
  <p>however <code>returnurl</code> always holds the original <code>urlstring</code> value even if the response is different.</p>
  
  <p>cheers
  peter</p>