Explain this javascript
Could anyone please explain what the code below does, especially point 1
and 2:
1)
(function (carWeb) {
})(carWeb || (carWeb = {}));
2) why is the function declared inside
function GridView() {
}
// usercontrols.gridview.js
var carWeb;
(function (carWeb) {
carWeb.GridView = (function () {
function GridView() {
}
GridView.init = function (gridSelector, threeGridButtonSelector) {
GridView.gridSelector = gridSelector;
threeGridButtonSelector.on("click", this.setThree);
};
return GridView;
})();
})(carWeb || (carWeb = {}));
asosWeb.GridView.init($("#top.category-items"), $("#grid-view-threegrid")));
No comments:
Post a Comment