CROSS DOMAIN AJAX CORS ERROR | SoloLearn: Learn to code for FREE!

0

CROSS DOMAIN AJAX CORS ERROR

Hey guys, So I know that in ajax you can't do cross origin requests due to browser security reasons. However I need to do cross browser requests like this: const xhr = new XMLHttpRequest(); xhr.open("GET", "otherdomain", true); xhr.send(); So how do I do cross origin requests (on server not locally on a plugin) through ajax?

10/17/2020 10:45:51 PM

Hira A 👩🏻‍💻

1 Answer

New Answer

+2

CORS is usually set up by server. You can can not access resources which you don't have permissions. Request website owner to give permission and allow you to do what you want to do.