简体   繁体   中英

How fix error POST … net::ERR_CONNECTION_RESET

I have a textarea with ckeditor plugins. before, I have no problems using it and the data can be stored properly. but now I get the error "POST" ... path/url ... net :: ERR_CONNECTION_RESET. when I try to enter the process of running a good bit of text. but when I enter a long text and included with some of the code, the error appears. peroses storage I did as follows. p_post.php (form) -> p_post.js (validate) -> f_post.php (insert function).

The following is a script p_post.js

jQuery(function($) {
    var val_holder;
    $("form input[name='btnsubmit']").click(function() { // triggred click
        val_holder      = 0;
        var txtjudul    = jQuery.trim($("form input[name='txtjudul']").val()); // email field

        if(txtjudul == "") {
            $("span.txtjudul_val").html("Judul tidak boleh kosong.");
        val_holder = 1;
        }
        if(val_holder == 1) {
            return false;
        }

        val_holder = 0;

        $("span.validation").html("");

    var datastring = $('#mainform');            
    datastring.on('submit', function(e) {
    e.preventDefault();



      $.ajax({
      url: 'http://example.com/fungsi/f_post.php',
      type: 'POST',
      dataType: 'html',
      data: datastring.serialize(),
      beforeSend: function() {
      },

                    success: function(e) {
                        if(e == 1) {
                            $("span.txtalert_val").html("Judul, Isi & Tags tidak boleh kosong!!");
                        } else {
                            if(e == 3) {
                                $("form input[type='text']").val('');

                                setTimeout(function(){
                                document.location.reload();
                                },1000);

                                datastring.trigger('reset');
                        }
                        }
                    }
      });
        });
    });
});

and no problem with insert function.

Those kind of errors are generally generated in the server. You should check for errors in your server.

If you are using Windows with Apache , Event Viewer Application Log is a good start to gather more info

In *nix you should check your web server log .

我解决了一个奇怪的错误,当有IP地址冲突时,不知何故AJAX post请求也会收到这种错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM