Home › Forums › Calendar Products › Events Calendar PRO › Moving javascript to the footer
- This topic has 4 replies, 3 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
April 8, 2016 at 2:32 am #1099970
Angela
ParticipantHi there
I have just read the post https://theeventscalendar.com/support/forums/topic/moving-javascript-to-the-footer/ and I too appear to be having the javascript load in the head of my main site.Reading that it might be some code that would be causing the disruption I created a minimal install using the Twenty Fourteen theme and it too loads the JS in the header.
http://events.leedsdirectory.org/events/
This is causing conflicts in my main site as the calendar is not loading consistently.
If you could offer any advice on why this is happening and how to rectify it in the main site that will be great.
Thanks
April 8, 2016 at 1:00 pm #1100218Barry
MemberHi Angela,
Thanks for getting in touch!
Some amount of JS will indeed be loaded from within the head element and that’s to be expected. What I’m not too clear on are the specific problems you are facing.
Can you describe what you mean when you say the calendar isn’t loading consistently and is this something I would be able to see on the (test?) site you linked to where you are running only a default theme?
Thanks!
April 8, 2016 at 4:47 pm #1100316Angela
ParticipantHi there Barry
People have been experiencing a great deal of problems with the Events Calendar not loading and I am forever being inundated with emails and the local government and my contract manager are unable to load the calendar successfully.
I too am finding that I might have to refresh many times before the calendar loads.
http://leedsdirectory.org/whats-on/
There appears to be this issue
tribe-events.min.js:1 Uncaught TypeError: debug.time is not a function(anonymous function) @ tribe-events.min.js:1j @ jquery.min.js:2k.fireWith @ jquery.min.js:2n.extend.ready @ jquery.min.js:2I @ jquery.min.js:2Initially there was a problem with Comment Rating Fields Pro however the Author resolved that.
I then thought it might be WP Fastest Cache and have prevented it from caching the Events Calendar pages.
But then looking at the code it appears all of the Events Calendar javascript is loaded in the head. I thought that there may well be an issue with the order the scripts are being loaded. Did some research and found the link as mentioned in the initial post. In there it says that the majority of the Events Calendar javascripts should be loaded in the footer not the head. I am finding that all things are being loaded in the head both js and css. This is not just on my custom theme but on the Twenty Fourteen too.
My assumption may be wrong but going by what I have read Events Calendar js should load in the footer which it isn’t.
Any thoughts on what could be causing the hits and misses with the calendar?
Thanks
PS While writing this I have changed Jquery and all other scripts to load in the head to see if that makes a difference. It does seem to have had an effect in the sense of loading order however the calendar is still hit and miss for some views.
April 9, 2016 at 8:07 am #1100404Barry
MemberHi Angela,
Thanks for the extra detail.
My assumption may be wrong but going by what I have read Events Calendar js should load in the footer which it isn’t.
Again, I’d emphasize that it is perfectly correct and expected for some number of scripts enqueued by The Events Calendar and its associated plugins to do so in the head rather than the footer – this generally isn’t a cause for concern in of itself.
I too am finding that I might have to refresh many times before the calendar loads.
Well, it doesn’t seem to be the very snappiest of sites but the calendar views all work as expected when I visit. Could the need to refresh actually be more of a perception issue – in that it takes a few seconds longer than people are used to for pages to load, making them feel they ought to hit the refresh button?
If so, perhaps making adjustments to improve performance – such as adding caching systems or even upgrading to a more powerful hosting package might be part of the answer?
I also don’t see the JS errors you cited – can you detail how I’d replicate these (do they show up on a particular view or after you perform a certain type of action)?
April 24, 2016 at 9:35 am #1106425Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Moving javascript to the footer’ is closed to new replies.
