title: How to get current page loaded url from iframe
body: <p>I'm using iframe to load faroo.com as default src in frame when i search and move to other webpage using faroo.But still in the iframe  src its display faroo.com only i wanted to capture url of page that has loaded in iframe</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      $(function(){
          $('#frameid').load(function(){
              var z=$('#frameid').attr('src');
              console.log('hi '+z);
          });
  
          $('#clicked').on('click', function(){
              $('#frameid').attr('src', 'http://www.faroo.com/');    
          });
      });
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;iframe width="100%" height="500px" id="frameid" src="" name="iframe_a" &gt;&lt;/iframe&gt;
  
  &lt;p&gt;&lt;input type="button" value="click me!" id="clicked"&gt;&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The o/p at console.log is always faroo.com not the current website that has loaded</p>