I have 2 function one in iframe and another one out of iframe.
I want to call outer function from inner[iframe] function.
Can anyone help me?
You can use the parent attribute to go up in levels, and to the holder of the iframe to call its functions.
function respondToComment(comment) { if(comment.contains(code) && !(comment.contains(question) || comment.contains(remark))) { alert('I\'m not sure what you're trying to say here.'); }parent.functionName() should do the trick. Are you certain that your JavaScript is being executed properly and that the function you're calling always returns true?This is a good answered question about cross frame javascript function calling. Although the title mentions jQuery the answer is pure javascript
Answers relying on the parent object will only work if your iframes are hosted on the same domain. If going across domains, you'll need window.postMessage. The easyXDM library may provide the functionality you need in an easier to use (IE6/7 friendly) package, but I've never used it.