-
Notifications
You must be signed in to change notification settings - Fork 2
Uncaught ReferenceError: jQuery is not defined #1
Comments
I will test with newer versions of Grav, just to make sure. You should indeed see syntax like If Even if you do site-wide activation, you will still need to update the |
If this statement is correct then by default the plugin would do nothing, correct? The readme states that:
Reading this makes me think that the "active" value is only used when the plugin processes on a per-page basis. Inversely, if the "active" value is not used (not enabled), it should process all pages. Can you clarify what the default behavior is? Also, Further to your point above I added the following to the top of my page:
I cleared the cache, but still nothing. This doesn't work regardless of whether |
Thank you for highlighting the typos. I will correct those. The default global config is The separation of If you see syntax like |
Ok, so here is my current configuration:
At this point, I cannot sort the table. There is nothing indicating it can be sorted, and I cannot click the headers. Is there anything I can look for to help troubleshoot? |
Check your browser's developer console (I think F12 works in most browsers) and see if there's some sort of JavaScript error or something. If you send me a URL, I'm happy to look. |
I can't share the page as it's on an internal network, but I saw this in the console, maybe it's of some use:
Line 29 as referenced in the second error looks like this:
|
Tablesorter is a jQuery plugin. jQuery must be loaded to function properly. Grav should automatically be loading that. |
The default theme indeed does, I switched back to it and can see I'll leave it up to you to decide where the blame should be here since I don't know enough about Grav, maybe the jQuery base should be loaded on a per-theme basis, or maybe Grav should force it upon every theme, or maybe this plugin should include jQuery (sounds bad). Thanks for the help! |
Here's some more info that may be of use: in the Gantry framework (which my theme uses), you can add your own JS frameworks. However, even when I set the priority to 0 (or 10, it has nothing to compete with) I will still end up with this order in the code:
...so if the plugin was a bit more lenient on its placement of the script tag (don't place it at the end of the CSS, place it just before Just a thought, cheers. |
Well I hesitate to force load jQuery. I don't want the hassle of different versions and all that. The very top of the documentation makes it clear this is a jQuery plugin. As for the order, I'll have to look more into it. The plugin uses Grav's own pipelining functions to inject itself, so I don't know what control I have over placement. Thanks for the info! It will be helpful. |
I'm using Grav 1.2.4 and the latest version of the plugin. I'm getting this same issue with two different themes, namely the default "Antimatter" as well as "Hydrogen".
My
user/plugins/tablesorter/tablesorter.yaml
looks like this, which I think is the default:When I look at the source of a page (after cleaning cache, makes no difference), I just see a
<table>
. What's strange though is that if I setactive: true
in the above file, which I understand should make this plugin only work per-file (calling this attribute "active" is terribly confusing, it should be called "activate" or something but that's another subject), it doesn't start working but I do see a difference in behavior. Withactive: true
I no longer see just<table>
in my pages, but<table id="tstableid1" class="tablesorter">
. There is nothing in the pages themselves stating that the plugin should be used (i.e. noactive: true
).I've read the readme but I can't figure out what I'm doing wrong. Isn't this plugin just supposed to work on all tables if it's enabled?
The text was updated successfully, but these errors were encountered: