HI all i have some where there is Departments and department has some data like this
Department
Casual shoe
formal shoe
sports shoe
so i want to write an if condition where i should write an if condition like this
<script type="text/javascript">
$(document).ready(function () {
$.getJSON("/api/ProductLayout", function (data) {
$.each(data, function (idx, ele) {
$("<img/>").attr({ src: ele.ImageURL }).appendTo("#makeMeScrollable");
$("#makeMeScrollable").append('<span>' + ele.ProductName + '</span><h4>' + ele.Price + '$' + '</h4>');
if (ele.Department == "Shoes") {
alert(2);
//$(".img_main").empty();
$("<img/>").attr({ src: ele.ImageURL }).appendTo("#Watches");
$("#Watches").append('<span>' + ele.ProductName + '</span><h4>' + ele.Price + '$' + '</h4>');
}
else if (ele.Department = "Wallets") {
alert(3);
$("<img/>").attr({ src: ele.ImageURL }).appendTo("#BackPacks");
$("#BackPacks").append('<span>' + ele.ProductName + '</span><h4>' + ele.Price + '$' + '</h4>');
}
else if (ele.Department = "Belts") {
alert(4);
$("<img/>").attr({ src: ele.ImageURL }).appendTo("#Belts");
$("#Belts").append('<span>' + ele.ProductName + '</span><h4>' + ele.Price + '$' + '</h4>');
}
});
});
});
</script>
now i ant to write an if condition for shoe where if (ele.Department == "Shoes") i should get all the data of deaprtments which has "shoe" in it,jow can i write an condition for this