Js method to get the current URL of the IFRAME

  • 2020-03-29 23:44:46
  • OfStack

Many times when we're using iframes we're going to do paging and the url jump inside the iframe is not going to be directly available through the SRC property of the iframe

The method to get the current url of the iframe
 
parent.document.getElementById("content_info").contentWindow.location.href 

Where: content_info is the id of the iframe

Related articles: