• 13-07-2013, 10:38:11
    #1
    function commentPost(){
    	      $.ajax({
                type: "POST",
                url: home + "/ajax.php",
                data: $('form#commentForm').serialize(),
                success: function(x) {
    				if(x == 0){
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!', });
    				}elseif(x == 1){
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!', });
    				}else{
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!', });
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!',	});
                }
              });
    }
    Console'da Uncaught SyntaxError: Unexpected identifier hatası alıyorum.
  • 13-07-2013, 13:09:26
    #2
    samsunikinciel adlı üyeden alıntı: mesajı görüntüle
    function commentPost(){
    	      $.ajax({
                type: "POST",
                url: home + "/ajax.php",
                data: $('form#commentForm').serialize(),
                success: function(x) {
    				if(x == 0){
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!', });
    				}elseif(x == 1){
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!', });
    				}else{
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!', });
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!',	});
                }
              });
    }
    Console'da Uncaught SyntaxError: Unexpected identifier hatası alıyorum.
    Denermisiniz :
    function commentPost(){
    	      $.ajax({
                type: "POST",
                url: home + "/ajax.php",
                data: $('form#commentForm').serialize(),
                success: function(x) {
    				if(x == 0){
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!', });
    				}elseif(x == 1){
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!', });
    				}else{
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!', });
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!'});
                }
              });
    }
  • 13-07-2013, 13:28:12
    #3
    kingofseo adlı üyeden alıntı: mesajı görüntüle
    Denermisiniz :
    function commentPost(){
    	      $.ajax({
                type: "POST",
                url: home + "/ajax.php",
                data: $('form#commentForm').serialize(),
                success: function(x) {
    				if(x == 0){
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!', });
    				}elseif(x == 1){
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!', });
    				}else{
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!', });
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!'});
                }
              });
    }


    Alttaki fazla olan tırnağı kaldırmışsın ama üsttekiler duruyor ayrıca "elseif" yerine "else if" yazılmalı.
    function commentPost(){
    	$.ajax({
    		type: "POST",
    			url: home + "/ajax.php",
    			data: $('form#commentForm').serialize(),
    			success: function(x) {
    				if(x == 0) {
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!'});
    				} else if(x == 1) {
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!'});
    				} else {
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!'});
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!'});
    		}
    	});
    }
  • 13-07-2013, 17:06:37
    #4
    frdtrkc adlı üyeden alıntı: mesajı görüntüle
    Alttaki fazla olan tırnağı kaldırmışsın ama üsttekiler duruyor ayrıca "elseif" yerine "else if" yazılmalı.
    function commentPost(){
    	$.ajax({
    		type: "POST",
    			url: home + "/ajax.php",
    			data: $('form#commentForm').serialize(),
    			success: function(x) {
    				if(x == 0) {
    					$.msgBox({ title: "Uyarı", content: 'Lütfen Formu Boş Bırakmayınız!'});
    				} else if(x == 1) {
    					$.msgBox({ title: "Uyarı", content: 'E-Posta Adresiniz Geçersiz!'});
    				} else {
    					$.msgBox({ title: "Uyarı", content: 'Başarılı!'});
    					setTimeout(function(){ window.location = url; }, 2000);
    				}
    			},
    			error: function(x) {
    				$.msgBox({ title: "Uyarı", content: 'Hata Oluştu!'});
    		}
    	});
    }
    Sorun çözüldü elseif else if olarak düzeltildi