Skip to content Skip to sidebar Skip to footer

How To Manage Location.reload In Ajax.jquery

scenario: 'i want my page reload autmaticly after user input the data'. i try to search methode what the best. and i choose to use location reload my problem: when i use location.

Solution 1:

use document.location.reload() along with

$("#loading").hide();

inside success function. you success should look like.

success: function(msg){
    if(msg=="error1"){
    $("#status").html("Rak ini penuh");
    }elseif(msg=="sukses"){
    $("#status").html("Data berhasil disimpan")}else{
    $("#status").html("ERROR..penyimpanan data GAGAL!");
    }
    $("#loading").hide();
    document.location.reload();
    }

Post a Comment for "How To Manage Location.reload In Ajax.jquery"