I have an iFrame on my website that is pointing to another domain. When the user finishes filling out a form on the site in the iFrame, the site sends my website a URL. I want to take that URL and force the parent to load that URL. I was using the following code, but it did not work.
<script type='text/javascript'>
if (top !== self) top.location.href = self.location.href;
</script>
Basically, it appears that you are asking how you can detect the new
srcof theiframeafter it has redirected.Had your
iframepage been in the same domain as your own, this would be no problem. You would retrieve it like this:But because it’s an external domain, browsers will prevent you from do this as a security policy, you’re not allowed to access that information.