I cannot seem to remember how to do this, although it should be quite simple. I am displaying the categories in a select dropdown so that a customer can filter which products on my website, and I don't want it to show duplicate categories, since multiple products are in the same categories.
<select name="category" id="cateogry">
<% if(data.length){
for(var i = 0;i < data.length;i++) { %>
<option value="<%=data[i].CATEGORY%>"><%=data[i].CATEGORY%></option>
<% }
}else{ %>
<p>DOESN'T WORK</p>
<% } %>
</select>
what is the best way to go about this. Thanks in advance