mam problem z formularzem, który wysyła dane ajaxem na zewnętrzny serwer. Mianowicie po wciśnieciu entera strona jest przeładowywana lecz po kliknięciu buttona submit jest w porzadku (formularz znika, pojawia się inna treść).
Dodalem opcję preventDefault() lecz to nic nie pomogło. Mój kod wygląda następująco:
$("#u_1d_1").click(function(e) { e.preventDefault(); $.ajax({ type: "POST", url: "", dataType : 'json', data: { //dane }, success : function(json) { status = json['status']; msg = json['message']; if(status == '1') { //1 } else { //22 } }, error:function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(err.Message); } }); return false; });