{"id":1162031,"date":"2016-09-09T08:07:40","date_gmt":"2016-09-09T15:07:40","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/"},"modified":"2016-09-09T08:07:40","modified_gmt":"2016-09-09T15:07:40","slug":"what-javascript-needs-to-be-in-the-header","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/","title":{"rendered":"What javascript needs to be in the header?"},"content":{"rendered":"<p>I&#8217;m trying to get my main calendar pages optimized for better pagespeed. When I use a plugin like Autoptimize, which puts TEC javascript into the footer, the month view for mobile breaks. (When I click on days of the month, nothing loads.)<\/p>\n<p>I&#8217;m wondering which scripts that are loaded into the header are necessary there for things to work &#8211; especially for the month view. <\/p>\n<p>I have disabled all plugins that are not TEC related and switched to the 2014 theme.  I have included all the scripts that are loading in the header below.<\/p>\n<p>Are all these necessary or can I move some to the footer?<\/p>\n<p>Additionally, I&#8217;d give huge bonus points if you have any prepared files for Critical CSS in the header, as this would improve the appearance of the page loading faster.<\/p>\n<p>Thanks,<br \/>\nCraig<\/p>\n<p>&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n\/* &lt;![CDATA[ *\/<br \/>\nvar tribe_bootstrap_datepicker_strings = {&#8220;dates&#8221;:{&#8220;days&#8221;:[&#8220;Sunday&#8221;,&#8221;Monday&#8221;,&#8221;Tuesday&#8221;,&#8221;Wednesday&#8221;,&#8221;Thursday&#8221;,&#8221;Friday&#8221;,&#8221;Saturday&#8221;,&#8221;Sunday&#8221;],&#8221;daysShort&#8221;:[&#8220;Sun&#8221;,&#8221;Mon&#8221;,&#8221;Tue&#8221;,&#8221;Wed&#8221;,&#8221;Thu&#8221;,&#8221;Fri&#8221;,&#8221;Sat&#8221;,&#8221;Sun&#8221;],&#8221;daysMin&#8221;:[&#8220;S&#8221;,&#8221;M&#8221;,&#8221;T&#8221;,&#8221;W&#8221;,&#8221;T&#8221;,&#8221;F&#8221;,&#8221;S&#8221;,&#8221;S&#8221;],&#8221;months&#8221;:[&#8220;January&#8221;,&#8221;February&#8221;,&#8221;March&#8221;,&#8221;April&#8221;,&#8221;May&#8221;,&#8221;June&#8221;,&#8221;July&#8221;,&#8221;August&#8221;,&#8221;September&#8221;,&#8221;October&#8221;,&#8221;November&#8221;,&#8221;December&#8221;],&#8221;monthsShort&#8221;:[&#8220;Jan&#8221;,&#8221;Feb&#8221;,&#8221;Mar&#8221;,&#8221;Apr&#8221;,&#8221;May&#8221;,&#8221;Jun&#8221;,&#8221;Jul&#8221;,&#8221;Aug&#8221;,&#8221;Sep&#8221;,&#8221;Oct&#8221;,&#8221;Nov&#8221;,&#8221;Dec&#8221;],&#8221;clear&#8221;:&#8221;Clear&#8221;,&#8221;today&#8221;:&#8221;Today&#8221;}};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/vendor\/bootstrap-datepicker\/js\/bootstrap-datepicker.min.js?ver=3.2&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/vendor\/jquery-placeholder\/jquery.placeholder.min.js?ver=2.0.7&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/vendor\/jquery-resize\/jquery.ba-resize.min.js?ver=1.1&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n\/* &lt;![CDATA[ *\/<br \/>\nvar tribe_js_config = {&#8220;permalink_settings&#8221;:&#8221;\\\/%postname%\\\/&#8221;,&#8221;events_post_type&#8221;:&#8221;tribe_events&#8221;,&#8221;events_base&#8221;:&#8221;http:\\\/\\\/1de.e4c.myftpupload.com\\\/sewing-classes\\\/&#8221;};<br \/>\nvar tribe_js_config = {&#8220;permalink_settings&#8221;:&#8221;\\\/%postname%\\\/&#8221;,&#8221;events_post_type&#8221;:&#8221;tribe_events&#8221;,&#8221;events_base&#8221;:&#8221;http:\\\/\\\/1de.e4c.myftpupload.com\\\/sewing-classes\\\/&#8221;};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/src\/resources\/js\/tribe-events.min.js?ver=4.2.6&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n\/* &lt;![CDATA[ *\/<br \/>\nvar TribeEventsPro = {&#8220;geocenter&#8221;:{&#8220;max_lat&#8221;:38.911538,&#8221;max_lng&#8221;:-104.787463,&#8221;min_lat&#8221;:38.911538,&#8221;min_lng&#8221;:-104.787463},&#8221;map_tooltip_event&#8221;:&#8221;Event: &#8220;,&#8221;map_tooltip_address&#8221;:&#8221;Address: &#8220;};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/events-calendar-pro\/src\/resources\/js\/tribe-events-pro.min.js?ver=4.2.5&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/src\/resources\/js\/tribe-events-bar.min.js?ver=4.2.6&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/event-tickets-plus\/vendor\/jquery.deparam\/jquery.deparam.js?ver=4.2.6&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/maps.google.com\/maps\/api\/js?key=AIzaSyBB_kCZS6xhGU3KaFITZjN1S8ZA5YUTRuU&#038;ver=4.6&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n\/* &lt;![CDATA[ *\/<br \/>\nvar GeoLoc = {&#8220;ajaxurl&#8221;:&#8221;http:\\\/\\\/1de.e4c.myftpupload.com\\\/wp-admin\\\/admin-ajax.php&#8221;,&#8221;nonce&#8221;:&#8221;241f7ca89d&#8221;,&#8221;map_view&#8221;:&#8221;&#8221;};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/events-calendar-pro\/src\/resources\/js\/tribe-events-ajax-maps.min.js?ver=4.2.5&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar\/vendor\/chosen\/public\/chosen.jquery.min.js?ver=0.9.5&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/the-events-calendar-filterbar\/src\/resources\/js\/filter-scripts.min.js?ver=4.2.2&#8242;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217;&gt;<br \/>\n\/* &lt;![CDATA[ *\/<br \/>\nvar tribe_this_week = {&#8220;ajaxurl&#8221;:&#8221;http:\\\/\\\/1de.e4c.myftpupload.com\\\/wp-admin\\\/admin-ajax.php&#8221;};<br \/>\n\/* ]]&gt; *\/<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8217;text\/javascript&#8217; src=&#8217;http:\/\/1de.e4c.myftpupload.com\/wp-content\/plugins\/events-calendar-pro\/src\/resources\/js\/widget-this-week.min.js?<\/p>\n","protected":false},"template":"","class_list":["post-1162031","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What javascript needs to be in the header? -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What javascript needs to be in the header? -\" \/>\n<meta property=\"og:description\" content=\"I&#8217;m trying to get my main calendar pages optimized for better pagespeed. When I use a plugin like Autoptimize, which puts TEC javascript into the footer, the month view for mobile breaks. (When I click on days of the month, nothing loads.) I&#8217;m wondering which scripts that are loaded into the header are necessary there [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/\",\"name\":\"What javascript needs to be in the header? -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-09-09T15:07:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"What javascript needs to be in the header?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What javascript needs to be in the header? -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/","og_locale":"en_US","og_type":"article","og_title":"What javascript needs to be in the header? -","og_description":"I&#8217;m trying to get my main calendar pages optimized for better pagespeed. When I use a plugin like Autoptimize, which puts TEC javascript into the footer, the month view for mobile breaks. (When I click on days of the month, nothing loads.) I&#8217;m wondering which scripts that are loaded into the header are necessary there [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/","name":"What javascript needs to be in the header? -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-09-09T15:07:40+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/what-javascript-needs-to-be-in-the-header\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"What javascript needs to be in the header?"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1162031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1162031\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1162031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}