강의

멘토링

커뮤니티

Inflearn Community Q&A

tony's profile image
tony

asked

Understanding Backend JavaScript with Node.js Web Development

Ajax processing using JSON

ajax script error

Written on

·

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

Answer 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

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

tony's profile image
tony

asked

Ask a question