Thank you!
I am a super noob to require JS and I had a feeling it was something related to calling a require but just am still trying to get used to the frameworks in play
Thank you!
I am a super noob to require JS and I had a feeling it was something related to calling a require but just am still trying to get used to the frameworks in play
Hey,
Is there a way to reach define scoped javascript when using a widget? I am just trying to wrap the javascript code into a js file for my widget instead of having it in the template in script tags.
I am trying to do something like below and i'm realatively new to JS and I have gotten this working perfectly when I am going to a route that I've added just can't get it to work when I am rendering widgets...
define('forum/widgets/recruitment', [''], function () {
'use strict';
var recruitment = {};
recruitment.init = function(){
console.log('WOOT');
};
return recruitment;
});
You can close this thread..
Resolved by using app.loadJQueryUI()
Hey,
I am curious if there is a way to include jquery in my widgets template.. Right now I am using require(['https://code.jquery.com/jquery-3.1.0.min.js','https://code.jquery.com/ui/1.12.0/jquery-ui.min.js'], function(){}). I have no idea if this is the correct approach to including CDN hosted javascript in my widget. This seems to cause problems with jquery timeago throwing errors like "$(...).timeago is not a function" and "widgetAreas.find(...).timeago is not a function". Any tips would be greatly appreciated!
Use Case - Wanting to use JQuery datepicker in my widget for some reason it wasn't working
NodeBB Version - "1.1.2"'
Thanks,
Nick