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?

17th Oct 2020, 10:45 PM
Coder
Coder - avatar
1 ответ
+ 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