【问题标题】:ajax post not working when enabled ssl启用 ssl 时 ajax 帖子不起作用
【发布时间】:2013-10-21 04:28:25
【问题描述】:

我在启用 ssl 时使用 ajax post 时遇到问题。 http协议没问题 当协议为 https 时,它切换到 302 错误,我已经在三天内修复但不行,任何人都知道如何解决这个问题,请帮助我。提前谢谢

function ajaxToCart(url,data,mine) {

   var prefix = parent.location.protocol;

    url = url.replace('checkout/cart', 'ajaxcartsuper/ajaxcart');
    if (prefix == "http:") {
        // change to https
        url = url.replace("http://", "https://");
    }
    console.log(url);


        $jq.ajax({
            url: url,
            dataType: 'json',
            type : 'post',
            data : data,
            beforeSend: function(request){
                  showLoadingAnimation();

            },
            success: function(data){
     });
}

【问题讨论】:

  • 您是否在服务器上进行了一些 URL 重写?

标签: jquery ssl


【解决方案1】:

能否请您检查标题并查看“位置”中返回的内容。可能是网址不正确

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 2015-01-09
    相关资源
    最近更新 更多