CROSS DOMAIN AJAX CORS ERROR | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

17th Oct 2020, 10:45 PM
Coder
Coder - avatar
1 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.
18th Oct 2020, 12:51 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar