Home > Back-end >  Ajax jQuery working fine in localhost XAMPP but not Working in hpanel of hostinger
Ajax jQuery working fine in localhost XAMPP but not Working in hpanel of hostinger

Time:06-02

Ajax jQuery working fine in XAMPP but whenever I do upload in hpanel of Hostinger it doesn't work. please check my code

<script type="text/javascript">
        $(document).on('submit', '#ajax-form', function (e) {
        e.preventDefault();

        var formData = new FormData(this);
        formData.append("comment", true);

        $.ajax({
            type: "POST",
            url: "postcomment.php",
            data: formData,
            processData: false,
            contentType: false,
            success: function (response) { 
                location.reload(true);                    
            }
        });

    });
    </script>

CodePudding user response:

Try executing in console. for that you have to open your browser's inspect element. you can do it by pressing ctrl shift I. you might get error in console too if there is some. you can paste your ajax code over there. Also if it that doesn't work check your network tab once. you will surely get some hint what's wrong from your side.

  • Related