0

You tried to run jsom without loaded sp.js
try to call sp.js before running any jsom function as the following
$(document).ready(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', prepareTables);
});
so remove
window.onload = function()
{
populateCatalystC...