ฉันจะสร้างคำขอ AJAX HTTPS GET อย่างชัดเจนโดยใช้ jQuery ได้อย่างไร ฉันกำลังพยายามทำสิ่งต่อไปนี้ ในหน้า https ฉันมีบรรทัดที่มีรหัส $.get("/resource")
แต่ฉันได้รับข้อผิดพลาดต่อไปนี้
XMLHttpRequest cannot load http://www.site.com/resource. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.site.com' is therefore not allowed access.
เหตุใดการโทร AJAX จึงพยายามเข้าถึงหน้าโดยใช้โปรโตคอล HTTP หากทรัพยากรที่เกี่ยวข้องมาจากหน้า https หากเมธอด $.get(url) ทำเช่นนี้ตามค่าเริ่มต้น ฉันจะใช้ jQuery เพื่อทำคำขอ HTTPS GET ที่ชัดเจนได้อย่างไร บุคคลอื่นที่มีปัญหาคล้ายกันที่ http://forum.jquery.com/topic/jquery-get-ajax-call-on-http-page-to-https-on-same-domain ไม่สามารถแก้ไขได้
jQuery เวอร์ชันคือ 1.7.2