How to Make an AJAX HTTPS GET Request Using jQuery

后端 未结 4 1089
有刺的猬
有刺的猬 2020-12-25 13:46

How can I explicitly make an AJAX HTTPS GET request using jQuery? I am trying to do the following. On an https page, I have a line with the code $.get(\"/resource\")

4条回答
  •  执笔经年
    2020-12-25 13:56

    If the page you are on is an https page, and the page .get is trying to access is http, then that will not work due to same origin. However, you could just write out the ajax instead of short handing it with .get :)

    $.ajax({
        type: "GET", 
        url: "https://someurl"
    });
    

    Though I suppose to be fair, that is still a short of true javascript

提交回复
热议问题