{"id":17482999,"date":"2024-03-07T18:03:10","date_gmt":"2024-03-07T18:03:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/invalid-inline-script-3\/"},"modified":"2024-03-07T18:03:10","modified_gmt":"2024-03-07T18:03:10","slug":"invalid-inline-script-3","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/invalid-inline-script-3\/","title":{"rendered":"Invalid Inline Script"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When I create a new post, and before I publish it, I always get this error in the AMP Validation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br \/>\"node_name\": \"script\",<br \/>\"parent_name\": \"head\",<br \/>\"code\": \"DISALLOWED_TAG\",<br \/>\"type\": \"js_error\",<br \/>\"node_attributes\": &#091;],<br \/>\"text\": \"\\n\\t( function() {\\n\\t\\tvar query = document.location.search;\\n\\n\\t\\tif ( query &amp;&amp; query.indexOf( <strong>SINGLE_QUOTED_STRING<\/strong> ) !== <strong>INT<\/strong> ) {\\n\\t\\t\\twindow.name = <strong>SINGLE_QUOTED_STRING<\/strong>;\\n\\t\\t}\\n\\n\\t\\tif ( window.addEventListener ) {\\n\\t\\t\\twindow.addEventListener( <strong>SINGLE_QUOTED_STRING<\/strong>, function() { window.name = <strong>SINGLE_QUOTED_STRING<\/strong>; } );\\n\\t\\t}\\n\\t}());\\n\\t\\n\",<br \/>\"node_type\": \"ELEMENT\",<br \/>\"sources\": &#091;<br \/>{<br \/>\"type\": \"core\",<br \/>\"name\": \"wp-includes\",<br \/>\"file\": \"functions.php\",<br \/>\"line\": 7596,<br \/>\"function\": \"wp_post_preview_js\",<br \/>\"hook\": \"wp_head\",<br \/>\"priority\": 1<br \/>}<br \/>],<br \/>\"removed\": true,<br \/>\"reviewed\": true<br \/>}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin solves this problem by removing the script (thus the published version shows no AMP errors). Is there a way to solve this problem before publishing? Is it even important if it is being excluded?<\/p>\n","protected":false},"template":"","class_list":["post-17482999","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17482999","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\/17482999\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17482999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}