First of you should take care of CORS Errors, because normally trying to get or change something within an iframe will be blocked by the browser duo same-origin policy.
if idoc
is your iframe, do this:
idoc = idoc.contentWindow;
This should be the solution if you have no same-origin problems.
Also read this if you need further information: Ways to circumvent the same-origin policy
edit
Regarding the comments, the question is something like: "Why is the page scrolling down?"
Current possibility: If the event got triggered within an <a>
Tag and the Tag ahs a #ID
in the href
, the page will try to scroll to this position.
{edit follows after clearing facts with author - waiting for more input}