Closed tyamz closed 5 years ago
@tyamz, your scripts, and jQuery should be on the default layout, not on the page. Could you show the default layout?
@tyamz, your scripts, and jQuery should be on the default layout, not on the page. Could you show the default layout?
I meant to say layout, not page. I've made some changes to the post and posted the layout code. Please take a look.
@tyamz, will take a look 😉
One more thing, @tyamz, you're using OctoberCMS without any plugins?
@w20k Fortunately, the OctoberCMS plugins page copies over markdown-friendly.
October Demo | Provides features used by the provided demonstration theme. | 1.0.1 | Alexey Bobkov, Samuel Georges |
---|---|---|---|
Location | Location based features, such as Country and State. | 1.0.8 | Alexey Bobkov, Samuel Georges |
News and Newsletter | Simple news and newsletter plugin. | 1.10.9 | Gergő Szabó |
User | Front-end user management. | 1.4.6 | Alexey Bobkov, Samuel Georges |
Builder | Provides visual tools for building October plugins. | 1.0.23 | Alexey Bobkov, Samuel Georges |
Pages | Pages & menus features. | 1.2.20 | Alexey Bobkov, Samuel Georges |
Backend Plus | New useful features and widgets for back-end. | 1.6.8 | Gergő Szabó |
Wysiwyg Editors | Inject your favorite Wysiwyg Editor to CMS and other Code Editor | 1.2.9 | Anand Patel |
User Downloads | User Download Manager | 1.0.9 | Thomas Yamakaitis (for The Compuflex Corporation - © 2017 The Compuflex Inc. All rights reserved. |
Contact | Contact Us Form | 1.0.8 | Thomas Yamakaitis (for The Compuflex Corporation - © 2017 The Compuflex Inc. All rights reserved. |
FAQs | Frequently Asked Questions Plugin | 1.0.5 | Thomas Yamakaitis |
Company | Extends the RainLab User Plugin to assign users to companies | 1.0.14 | Thomas Yamakaitis |
Blog | A robust blogging platform. | 1.2.19 | Alexey Bobkov, Samuel Georges |
Statistics and logging of emails. | 1.3.0 | Matiss Janis Aboltins | |
Logger | This is a simple plugin that logs the identity of machines requesting specific pages. | 1.0.2 | Thomas Yamakaitis |
Administrator | This plugin will extend the back end user model to enhance and add features for the back end user experience. | 1.0.2 | Thomas Yamakaitis |
MailChimp | Provides MailChimp integration services. | 1.0.4 | Alexey Bobkov, Samuel Georges |
Sitemap | Generate a sitemap.xml file for your website. | 1.0.8 | Alexey Bobkov, Samuel Georges |
Compuflex Blog | Extends the RainLab Blog Plugin to add additional functionality | 1.0.12 | Thomas Yamakaitis |
Renatio Logout | Manage user session. | 3.0.1 | Renatio |
This plugin will allow users to log in with their LinkedIn account and post comments to the blog. | 1.0.5 | Thomas Yamakaitis | |
Gallery | Dynamic Photo Gallery plugin that creates dynamic photo displays. | 1.0.6 | Thomas Yamakaitis |
@tyamz, could you also take a look what response you get from ajax call? In dev tools -> network tab? And also post what is inside the blog.js if possible.
@tyamz, could you also take a look what response you get from ajax call? In dev tools -> network tab? And also post what is inside the blog.js if possible.
@w20k I'm confused, it just randomly started working again. I'll close this for now.
[UPDATE]
I have been able to pinpoint the issue down to a particular partial update. It is only when I update the partial with 'blogPosts/postList', but other partial updates do not cause the jQuery TypeError. I'm not sure what exactly is causing it. I've added more code to this post as well as the paths to the files to help understand what's going on.
PLEASE NOTE: There is a lot of code below. I did not just post random code hoping you could find the issue. I've selected these code blocks purposely because I feel that they may be relevant to finding out whether this is a bug or just a mistake on my part. I feel that I've exhausted my personal search efforts which is why I'm asking here anyway.
I have an OctoberCMS component that has an AJAX Handler for
onSelectTag
, but when the#posts
HTML element is updated (rendered) with theblogPosts/postList
partial, the following error is thrown:/plugins/example/blog/components/filter/tagList.htm:
/themes/demo/pages/blog.htm
/themes/demo/layouts/blog-layout.htm:
onSelectTag() AJAX Handler:
/themes/demo/partials/blogPosts/postList.htm:
/plugins/example/blog/component/posts/default.htm
I don't think the reference or load order is the issue because I've tried moving the jQuery reference and the
{% framework extras %}
reference and the{% scripts %}
reference to many different parts of the layout, and nothing changed either way.My theory:
I think that when the partial updates, it's messing up the jQuery Framework call or something. It's odd because jQuery functions still work like:
That still works, but functions defined by the OctoberCMS AJAX framework like
$.request(...)
do not work. I'm not sure why this is happening though.