ارور AJAX در مرورگر
سلام استاد وقتی میخوام اطلاعات فایل .txt رو دریافت کنم ارور زیر رو میده همه چیز هم درسته ولی....:
Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
loadText @ script.js:9
script.js:10 READYSTATE: 1
script.js:18 Access to XMLHttpRequest at 'file:///E:/D%20drive/01-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%20%D9%86%D9%88%DB%8C%D8%B3%DB%8C/02-JavaScript/01-MY_FILES/26-AjaxEvents/new.txt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, edge, https, chrome-untrusted.
loadText @ script.js:18
script.js:18 GET file:///E:/D%20drive/01-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%20%D9%86%D9%88%DB%8C%D8%B3%DB%8C/02-JavaScript/01-MY_FILES/26-AjaxEvents/new.txt net::ERR_FAILED
loadText @ script.js:18
script.js:18 Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///E:/D%20drive/01-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%20%D9%86%D9%88%DB%8C%D8%B3%DB%8C/02-JavaScript/01-MY_FILES/26-AjaxEvents/new.txt'.
at HTMLButtonElement.loadText (file:///E:/D%20drive/01-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%20%D9%86%D9%88%DB%8C%D8%B3%DB%8C/02-JavaScript/01-MY_FILES/26-AjaxEvents/script.js:18:6)
loadText @ script.js:18
script.js:18 XHR failed loading: GET "file:///E:/D%20drive/01-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%20%D9%86%D9%88%DB%8C%D8%B3%DB%8C/02-JavaScript/01-MY_FILES/26-AjaxEvents/new.txt".
loadText @ script.js:18
پاسخ ها
محمد هاشمی
سلام پرهام عزیز
این اکستنشن رو روی مرورگرت نصب کن و فعالش کن
Moesif CORS
اینم لینکش :
Moesif Origin & CORS Changer - Chrome Web Store (google.com)
parham karimipoor
خیلی ممون استاد عزیز
برای ثبت پاسخ باید خود شوید