I'm trying to run a javascript function, which is located inside the iframe.
<script>
document.getElementById('myFrame').contentWindow.setupCookie()
</script>
<iframe id="myFrame" src="iframe.html"></iframe>
iframe.html
<script>
function setupCookie() {
document.cookie = "guvenli=1";
}
</script>
<center style="margin-top:200px;">
<a href="javascript:;"
onClick="setupCookie(); location.href='/index.php'">Enter Site >></a></center>
What is the correct way to do that ?