Hi guys,
I have a very odd problem. I recently moved my site to a new server. Following the modx instructions I did not have any problems, and the webpage worked fine.
I am using some chunks in the header of my template. In one of the chunks I am loading "jquery"
<script type="text/javascript" src="../jquery.min.js"></script>
Whenever I clear the cache, jQuery is loaded and everything works fine! However, when reloading or changing to another page, the row where I load jQuery is deleted and does not appear in the browsers source code. This problem is repeatable, it works fine after clearing the cache (either in the manager, or manually by deleting the content of the core/cache folder).
I can change anything else in the chunk, I have also some other javascripts loading in that chunk. No problems! Everything that I change will appear in the browser sourcecode. I added a commented line before and after the jQuery command. Even these comments will appear in the sourcecode of the browser, but there is a blank line instead of jQuery between them.
This problem does seem to appear only for this template. I am using a second template, where the loading of jQuery works fine.
I checked "modx_site_htmlsnippets" in the database and the sourcecode is ok there. Even after reloading and showing the wrong content in my browser, the database entry is correct.
I have also tried to re-run the setup. No success.
I used the same source to create another website. On that copy I don't have this problem.
Gettin' crazy!!
Any ideas?
Cheers
Marco
modx version: 2.3.2
-
☆ A M B ☆
- 24,524 Posts
Can you post the part of the template with the chunk tag, and post the contents of the chunk?
Have you tried this?
[[!$sinaki.menu-head-append]]
-
☆ A M B ☆
- 24,524 Posts
The only thing that comes to mind is something is removing the lines after the page is generated but before it is sent by the web server back to the requesting browser. A plugin, perhaps? Or perhaps some kind of security setting on the server that does not permit javascript sources from external URLs? Or perhaps even some kind of security setting on the client's machine or LAN router/firewall to prevent javascript URLs from third-party URLs?
-
☆ A M B ☆
- 1,780 Posts
Stab in the dark, but what is before that chunk? A mistake I made before a jquery script recently solved a similar issue, it may be worth inspecting the surrounding code.