function GetDiagrams(componentID) {
$.getJSON("../PlanView/GetDiagrams", { ComponentID: componentID }, function (diagrams) {
for (var i = 0; i < diagrams.length; i++) {
PaintDiagram(diagrams[i]);
}
});
}
All I am doing is calling PaintDiagram on each element returned. I tried Googling for a bit because I am pretty confident this is easily reducible, but was not able to pull up a quick example.
Is this function a candidate for any more refactoring?