Search⌘ K
AI Features

Solution Review: Same Origin Policy

Explore the same-origin policy to understand how JavaScript limits access between pages with different origins to protect against cross-site scripting attacks. Learn how protocols, hostnames, and ports factor into the policy and how document.domain can be used to allow controlled subdomain interactions.

Question 1: Solution review

Explanation

The same-origin policy checks if two URLs have the same origin. It ensures that a script from one page can only access data from another page if it is of the same origin; hence, Options A & D are incorrect.

It is a critical security measure to isolate any malicious documents and to ...