Read the statement by Michael Teeuw here.
Adding jQuery
-
@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!
-
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
jQuery
is installed in your module’snode_modules
folder, and not at the root of your MagicMirror (I may however be wrong).In which case I would expect
jQuery
to 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
Tabulator
code 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.