i'm coding a website in MVC
so i am sending data with ajax, is this way safe? can they manipulate my data?
i'm coding comments section so i am using the ajax to load comments page by page. Also i'm using ajax about this like and dislike situation
is there any problem about security? What should i do extra?
example codes ;
<script type="text/javascript">
$(document).ready(function () {
YorumlariYenile("yorumlar", @(Model.KullaniciVeri.KULLANICI_ID), "PROFIL_YORUM", 1);
});
function YorumlariYenile(divId, HedefId, HedefMod, SayfaNo) {
$("#" + divId).load("@(Url.Action("YorumCek", "Sayfa", null, Request.Url.Scheme))?HEDEF_ID=" + HedefId + "&HEDEF_MOD=" + HedefMod + "&SAYFA_NO=" + SayfaNo + "&DIV_ID=" + divId);
}
function Yorumla(divId) {
if ($("#" + divId).is(":visible")) {
$("#" + divId).hide();
} else {
$("#" + divId).show();
}
}
function YorumSil(YorumId) {
$.ajax({
type: "POST",
url: "@(Url.Action("YorumSil", "Sayfa"))",
data: { YORUM_ID: YorumId },
success: function (data) {
YorumlariYenile("yorumlar", @(Model.KullaniciVeri.KULLANICI_ID), "PROFIL_YORUM", 1);
if (data != "Başarılı!") {
$("#bilgiModal").modal("show");
$("#bilgiLabel").text("Başarısız");
$("#bilgiIcerik").html(data);
}
}
});
}
function YorumYap(Yorum, HedefId, HedefMod, Spo) {
$.ajax({
type: "POST",
url: "@(Url.Action("YorumYap", "Sayfa"))",
data: { txtYorum: Yorum, HEDEF_ID: HedefId, HEDEF_MOD: HedefMod, Spoiler: Spo },
success: function (data) {
YorumlariYenile("yorumlar", @(Model.KullaniciVeri.KULLANICI_ID), "PROFIL_YORUM", 1);
if (data != "Başarılı!") {
$("#bilgiModal").modal("show");
$("#bilgiLabel").text("Başarısız");
$("#bilgiIcerik").html(data);
}
}
});
}
function DegerlendirmeYap(HedefId, HedefMod, Begenme_Durumu) {
$.ajax({
type: "POST",
url: "@(Url.Action("DegerlendirmeYap", "Sayfa"))",
data: { HEDEF_ID: HedefId, HEDEF_MOD: HedefMod, BEGENME_DURUMU: Begenme_Durumu },
success: function (data) {
YorumlariYenile("yorumlar", @(Model.KullaniciVeri.KULLANICI_ID), "PROFIL_YORUM", 1);
if (data != "Başarılı!") {
$("#bilgiModal").modal("show");
$("#bilgiLabel").text("Başarısız");
$("#bilgiIcerik").html(data);
}
}
});
}
function DegerlendirmeCek(spanId, HedefId, HedefMod, Begenme_Durumu) {
$.ajax({
type: "POST",
url: "@(Url.Action("DegerlendirmeCek", "Sayfa"))",
data: { HEDEF_ID: HedefId, HEDEF_MOD: HedefMod, BEGENME_DURUMU: Begenme_Durumu },
success: function (data) {
$("#" + spanId).text(data);
}
});
}