Why is it that I can submit a form to an iframe with a cross-domain address but can’t send an XMLHTTPRequest to that address?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For the very simple reason that your code doesn’t get to see the result of the iframe post. Your script will be denied access to the iframe’s DOM.
And keep in mind this is really the browser’s security model, not JavaScript’s.