{"id":6137209,"date":"2015-05-16T18:32:03","date_gmt":"2015-05-16T18:32:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/last-isola-theme-update-breaks-javascript-in-header\/"},"modified":"2016-08-24T16:19:03","modified_gmt":"2016-08-24T16:19:03","slug":"last-isola-theme-update-breaks-javascript-in-header","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/last-isola-theme-update-breaks-javascript-in-header\/","title":{"rendered":"Last Isola Theme Update Breaks Javascript in Header"},"content":{"rendered":"<p>Hey, everyone! I&#8217;ve got Javascript that behaves in the following manner at <a href=\"http:\/\/lhore.com\">http:\/\/lhore.com<\/a>.<\/p>\n<p>1. Before a theme update for Isola (now Version 1.0.5), Javascript executed just fine in the &lt;HEAD&gt; &lt;\/HEAD&gt; portion of header.php.<\/p>\n<p>2. After the theme update for Isola, the header.php file was overwritten and now that same Javascript no longer executes.<\/p>\n<p>Here&#8217;s my Javascript that ran just fine before the update.<\/p>\n<pre><code>&lt;!-- START LOOTSIE INTEGRATION CODE --&gt;\n&lt;script&gt;\n\twindow.lootsieInit = function(){\n\t\tconsole.log(&#039;init&#039;);\n\t\tvar app_key = &quot;your-unique-key-redacted&quot;;\n\t\tvar achievement_id = &quot;welcome&quot;;\n\t\tloyaltyPlatform.lootsieINIT(app_key).then(function(success){\n\t\t\t\/\/show lootsie IAN\n\t\t\tloyaltyPlatform.lootsieACHIEVEMENT(achievement_id);\n\t\t}).catch(function(error){\n\t\t\tconsole.log(&quot;error&quot;, error);\n\t\t});\n\t};\n\n\t(function(d, s, id){\n\t\tvar js, fjs = d.getElementsByTagName(s)[0];\n\t\tif (d.getElementById(id)) {return;}\n\n\t\tjs = d.createElement(s);\n\t\tjs.id = id;\n\t\tjs.src = &quot;https:\/\/browser\u00adsdk.lootsie.com\/1.0.1\/js\/lootsiebrowsersdk.min.js&quot;;\n\t\tfjs.parentNode.insertBefore(js, fjs);\n\t}(document, &#039;script&#039;, &#039;lootsie\u00adbrowser\u00adsdk&#039;));\n&lt;\/script&gt;\n&lt;!-- END LOOTSIE INTEGRATION CODE --&gt;<\/code><\/pre>\n<p>And <a href=\"https:\/\/youtu.be\/QnRSxJyYrr8?t=2m7s\">here&#8217;s a video<\/a> (at 2:07) where you can see exactly what that Javascript did.<\/p>\n<p>I see the markup as a part of the page when I view the source, which seems correct (I&#8217;m now trying to move it in\/out of the &lt;HEAD&gt; tag). The explanation now would seem up to how WordPress and the Isola theme now load up; why would something in the &lt;HEAD&gt; tag not execute, even later? The Javascript is made to execute eventually, and the service is indeed up (we&#8217;ve got it running at http:\/\/lootsie.com).<\/p>\n<p><strong>Is Isola doing something special that I must now develop around to get old, working Javascript to execute within it?<\/strong><\/p>\n","protected":false},"template":"","class_list":["post-6137209","topic","type-topic","status-closed","hentry","topic-tag-head","topic-tag-header","topic-tag-javascript"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6137209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6137209\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6137209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}