2016-06-09 21 views
-1

Dieses Skript ist Teil meiner Website, warum nicht die Seite aktualisieren?aktualisieren Sie die Seite nach Ajax Erfolg

Ich testete andere Methoden auf dem Stackoverflow aber nicht beantwortet.

Helfen Sie mir, dank

$(document).ready(function (e) { 
    $("#loginform").on('submit',(function(e) { 

    var show_result_ajax = $("#show-result-ajax-loginform"); 

     e.preventDefault(); 
     $.ajax({ 
      url: "inc/custom/login.php", 
      type: "POST", 
      data: new FormData(this), 
      contentType: false, 
      cache: false, 
      processData:false, 
      success: function(data) 
      { 

       if(data != 'empty_error'){ 
        show_result_ajax.fadeOut(function(){ 
          show_result_ajax.html(data); 
        }); 
        show_result_ajax.fadeIn(); 
       } 
       else 
       if(data == 'empty_error'){ 
        window.location.reload(); 
       } 


      } 
     }); 
    } 
)); 

}); 
+0

was Ajax zurückkehrt? –

+0

Hallo Mohammad, liefern die Daten deinen Ausdruck? Haben Sie es mit dem Konsolenprotokoll überprüft? –

+0

Hallo @ KamuranSönecek, ja – Mohammad

Antwort

2

testen

$(document).ready(function (e) { 
    $("#loginform").on('submit',(function(e) { 

     e.preventDefault(); 

     var show_result_ajax = $("#show-result-ajax-loginform"); 

     $.ajax({ 
      url: "inc/custom/login.php", 
      type: "POST", 
      data: new FormData(this), 
      contentType: false, 
      cache: false, 
      processData:false, 
      success: function(data) 
      { 
       if(data != 'empty_error'){ 
        show_result_ajax.fadeOut(function(){ 
         show_result_ajax.html(data); 
        }); 
        show_result_ajax.fadeIn(); 
       } 
       else if(data == 'empty_error'){ 
        location.reload(); 
       } 
      } 
     }); 

     return false; 
    })); 

}); 
+0

Leider hat es nicht funktioniert. – Mohammad

+1

Bitte, zeigen Sie "Daten" Ajax Anfrage – Vitaly

+0

WOW, ich habe mein Problem gefunden. – Mohammad

Verwandte Themen