How to Make an AJAX HTTPS GET Request Using jQuery

后端 未结 4 1013
有刺的猬
有刺的猬 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 14:09

    Try setting the datatype to "jsonp", that's helped me in the past with cross-origin requests.

        $.ajax({
                url: "//www.site.com/resource"
                dataType: "jsonp",
                success: function(data) {
                    $(".demo-card").html(data);
                }
        });
    

提交回复
热议问题