I could hardly restrain myself from biting into my desk out of frustration yesterday, trying to use Masonry on a custom page. My theme script file (nodebb-theme-themename/static/lib/themename.js
) is correctly listed in plugin.json
but not included in the minified nodebb.js
.
On the other hand (which is what troubled me), when I tried to include a script in the page itself that loads Masonry from a CDN and just initializes a masonry object, it kept being undefined.
So maybe someone can tell me what is wrong here:
$().ready(function(){
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.0/masonry.pkgd.js", function(){ console.log('Script has been successfully loaded!'); });
var masonryTest = new Masonry();
});
that just gives
// Uncaught ReferenceError: Masonry is not defined
// (anonymous function) @ VM162:2
// InjectedScript._evaluateOn @ VM117:883
// InjectedScript._evaluateAndWrap @ VM117:816
// InjectedScript.evaluate @ VM117:682
Go ahead, try it yourself in the console at my site.
I have the feeling I overlook the obvious...