For example:
script.js:
function functionFromScriptJS() {
alert('inside functionFromScriptJS');
}
iframe.html:
<html>
<head>
<script language="Javascript" src="script.js"></script>
</head>
<body>
<iframe>
<body>
<script language="JavaScript">
functionFromScriptJS();
</script>
</body>
</iframe>
</body>
<html>
The above call to functionFromScriptJS() is not working.
The first guess parent.functionFromScriptJS() is not working too.
Is it possible to access such an external function from an iframe when the include is not in the iframe itself but in the parent document?
@Edit: So my mistake was that I put the document inside the iframe tag, and I sould have put it in a separate file and specified through the src attrubute of the tag. In this case parent.functionFromScriptJS() works.