0

So I am trying to extract data from the result of a submission of a form, that is located inside an iFrame using injected javascript.

I do this by using a mouseover event that activates when the current element is a link and has a particular id.

However, when calling the function submitAction_win0:

    var forms = document.getElementsByTagName('form'); 
    submitAction_win0(forms[0],nameOfSomething);

I get

"Uncaught ReferenceError: submitAction_win0 is not defined".

However when I click "View Frame Source" I can find:

    function submitAction_win0(form, name){
       //some code
    }

located in the head before the body.

I also used document.body.innerHTML to verify if I was looking at the right page and I got the same body HTML.

EDIT: tried putting parent before the function:

    parent.submitAction_win0(forms[0],nameOfSomething);

And I received this error:

"Uncaught TypeError: parent.submitAction_win0 is not a function"

scatta678
  • 17
  • 1
  • 6
  • 1
    possible duplicate of [Calling a parent window function from an iframe](http://stackoverflow.com/questions/2161388/calling-a-parent-window-function-from-an-iframe) – Jan Aug 21 '15 at 23:15
  • I saw that one and tried it before posting this, didn't work – scatta678 Aug 21 '15 at 23:18
  • Still sounds like it could be a scope issue. Post an MCVE http://stackoverflow.com/help/how-to-ask Any answer to your current question would just be a guess. – Jan Aug 21 '15 at 23:23

0 Answers0