When i use slice to remove the first array I keep getting.
TypeError: data.slice is not a function
http://localhost/dev/ajax/error.html
My json data is as follow. I’m trying to remove “success:true
{"success":true,"errOne":"Message One","#errTwo":"Message Two","#errThree":"Message Three"}
My jQuery code
dataType:"json",
cache:false,
success: function(data){
$('#errors div').empty();
data.slice(1);
How to correct this?
You mean the slice/splice functions, this functions works only on arrays and what you have here is a JSON object, try using the delete action:
delete data['success']