강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của tony
tony

câu hỏi đã được viết

Hiểu JavaScript phụ trợ thông qua phát triển web Node.js

Xử lý Ajax bằng JSON

ajax script error

Viết

·

336

0

XMLHttpRequest cannot load http://127.0.0.1:3000/ajax_send_email. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. 버튼을 클릭하면 위에 에러를 보게 됩니다. 어떻게 처리하면될가여?
javascriptnodejsexpress

Câu trả lời 2

5

form.html script 태그에서 sendAjax 함수 인자 URL을 http://127.0.0.1:3000/ajax_send_email 에서 http://localhost:3000/ajax_send_email 로 바꿔 보세요. 자세한 내용은 링크(https://coding-groot.tistory.com/91) 확인해보세요.

0

댓글보고 해결되었습니다! 감사합니다

Hình ảnh hồ sơ của tony
tony

câu hỏi đã được viết

Đặt câu hỏi