I am using this piece of code on a couple of sites within my SharePoint Online environment:
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
alert('test');
//my code follows
});
Although, this code doesn't work on some pages (I don't get the alert)
I've checked in the browser, SP.js is actually loaded. Any ideas???