MK.
MK.

Reputation: 34527

understanding JavaScript security model

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?

Upvotes: 2

Views: 322

Answers (1)

bhamlin
bhamlin

Reputation: 5187

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.

Upvotes: 4

Related Questions