I have the following code to get a json response using ajax. From the response I am taking the "prodId". More responses are coming to the page when the page load and each response will contain different "prodId"s. I need to check the "prodId" is already recieved or not. I have some divs already in the page with the above recieved prodId.
I am new to handling array. One thing to remember that all the json responses are coming in the page load itself. So after getting the first response I need to check any duplicate response is coming and should avoid it. Please help me out
$.ajax({
type: "GET",
dataType: "jsonp",
success: function(data){
prodId = data.prodID;
//populate this data in page
});