angular basics

Cross Domain Ajax

What is same origin policy?
Browsers allow a web page to make AJAX requests only with in the 
same domain. Browser security prevents a web page from making
AJAX requests to another domain. This is called same origin policy.

URIs have the same origin
 http://localhost:1234/api/employees
http://localhost:1234/Employees.html

Different origins: Because they have different port numbers
http://localhost:1234/api/employees
http://localhost:5678/Employees.html


Different origins: Because they have different domains
http://mahesh.com/api/employees
http://mahesh.net/Employees.html





Comments

Popular posts from this blog

reactjs questions part 4

ReactJS: How and when to force a React component to re-render

Q: Error Boundary in React that catches an error and displays a fallback UI