강의

멘토링

커뮤니티

Inflearn コミュニティ Q&A

tony のプロフィール画像
tony

投稿した質問数

Node.js Web開発で学ぶバックエンドJavaScriptの理解

JSONを活用したAjax処理

ajax script error

作成

·

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

回答 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 のプロフィール画像
tony

投稿した質問数

質問する