Try to use it as given below: SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){alert('Test')});