Hay Guys,
i have a problem.
Is there any way to prevent client-side manipulation on HTML data-attributes.
My problem is, if someone is clever enougth to look at the source code and changing the attribute, for example im using jQuery/ajax to get the value of my data-attribute and send it with ajax to my controller. My controller now starts to look with switch case is matching with my data i got out of my data-attr.
But if i change the data-attr value in something that doesnt even exist it shows my the default case.
Is there any way i can prevent / avoid this problem.
var saveAttr = jQuery('#example').attr("data-attr");
jQuery.ajax({
url: "forexample",
method: "POST",
data: { action: "someCaseinMyController", saveAttr:saveAttr },
}).done(function (response){
jQuery("#someDiv").html(response);
});
Is there any way to prevent client-side manipulation on HTML data-attributes?=> no.