Read the statement by Michael Teeuw here.
Adding jQuery
-
Hi,
Im trying to develop a module and it would be helpfull to have jQuery but im not sure how to include it. when im using thegetScripts: function() {
return [“jQuery.js”];
},*/everything just turns black and nothing loads. Any idea of what to do?
-
@snimax you probably getting an error in the console that it can’t find the script jquery make sure you add it to your module folder
-
Ah so if i want to use it for multiple modules, do i have to add the file to every modules folder or is there a “universal” place for them?
-
@snimax yes otherwise a user who will use only one of your modules is not able to use it correctly https://github.com/MichMich/MagicMirror/blob/master/modules/README.md#getscripts
-
Okey thank you very much!
-
@strawberry-3-141
It seem that getscripts doesn’t work anymore, at least not as I expected. This seem to be because even though MM finds the script, we get hit by the security error:
The resource from “http://192.168.1.2:8080/node_modules/jquery-ui-dist/jquery-ui.css” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).Any idea how to get past this?
-
@E3V3A When I look up the error, I find this thread which says:
Check if the file path is correct and the file exists - in my case that was the issue - as I fixed it, the error disappeared.
I suspect that
jQueryis installed in your module’snode_modulesfolder, and not at the root of your MagicMirror (I may however be wrong).In which case I would expect
jQueryto be installed at“http://192.168.1.2:8080/modules/MMM-Tabulator/node_modules/jquery-ui-dist/jquery-ui.css”. This is why in your thread here you needed to usethis.file()so that it created a relative path. -
@ninjabreadman Oh man, Excellent! I wish I’d had seen that a week ago…
Anyway, I’ve solved it since, but got another issue with getting the
Tabulatorcode to actually do something. No errors shown, unfortunately.PS. Is there a way to close a thread or mark it as solved??
-
@E3V3A
Yes, at the end of the thread there is a button with a gear symbol. Tap/click it and selectMark as question, then tap/click a second time and selectMark as resolved -
@yawns I must be blind!?

-
@E3V3A
No, I guess it’s my mistake. As a moderator I have these options. And I think the thread starter has the option as well.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login