How do I parent redirect visitors to another page if page inside iframe loaded 8 times?
<p>I have embedded a webpage inside iframe and want to parent redirect visitors to another webpage if the page inside iframe has been loaded 8 times? Any idea how to do it?</p>

<p>I can redirect every time when the iframe page load with the following codes.</p>

<pre><code>function replaceLoad(oIframe) {
    oIframe.onload = function () {
    location.href = 'www.google.com'
    }
}

&lt;iframe id="xMyIframe" src="url" onload="replaceLoad(this)"&gt;
&lt;/iframe&gt;
</code></pre>

<p>How can I modify it to suit my purpose?</p>

<p>Thank you</p>