If someone tries to violate the rule that you have set, what do you do in return? Send them an Script error. Not in real life, though.  But in JavaScript, if you try to violate the same origin policy, the browser will send you a ‘Script error’ in return. When Do Script Error Occur in JavaScript Code? When an exception violates the same origin policy of a browser in response to the onerror callback, the browser responds with a ‘script error.’ Same Origin Policy:…