AJAX works on localhost, but doesn't on live server

前端 未结 6 1245
滥情空心
滥情空心 2021-01-28 08:32

Below code works on localhost, but not on live server.

MAIN EDIT:

Only 1 thing remains which is not working:

<
6条回答
  •  礼貌的吻别
    2021-01-28 09:19

    Try adding an error handler to your Ajax function and see what it returns:

    $.ajax({
        url: "controller.php",
        type: "POST",
        data: post,
        cache: false,
        dataType: "json",
        beforeSend: function () {
          saveScore();
        },
        success: function (data) {
          $(".FixedDiv").addClass("panel-danger");
          setTimeout(close, 500);
          $("#label_" + res[2]).html(data.score_result);
          $("#monitoring_score").html(data.calculated_score);
        },
        error: function(data) {
          console.log("ERROR: ", data);
        }
      });
    

    Share the result with us so we can trouble shoot your issue and help you.

提交回复
热议问题