0

I need to access the below iframe with javascript to allow me to auto input a set username and set password in the form and then submit it. :

<iframe src="http://example.com" id="mainForm"></iframe>

how is this done?

2
  • Is the Iframe on the same domain as the parent page? Commented May 6, 2014 at 16:45
  • No i getting the source of the iframe from an external site. Commented May 6, 2014 at 20:17

1 Answer 1

1

The Same Origin Policy prevents you from manipulating the content of an Iframe from an different domain. This was put in place to prevent Iframed content from hijacking your privacy.

What you want cannot be done.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.