Kendo UI
jQuery + Kendo UI + MockJax
by burkeholland
HTML
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.metro.min.css">
<div id="log"></div>
JavaScript
var log = function(msg) {
$("#log").append("<p>" + msg + "</p>");
}
$(function() {
var items = [ "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" ];
log("<div class='k-header'>Before Map</div>");
// log each item in the "items" array
$.each(items, function(index, value) {
log(value);
});
// enumerate through the items array and remove the second item
var otherList = $.map(items, function(value, index) {
return index === 1 ? null : value;
});
log("<br /><div class='k-header'>After Map. Item 2 Is Removed</div>");
// log the "otherList" array to the window
$.each(otherList, function(index, value) {
log(value);
});
});