{"id":16039522,"date":"2022-09-24T05:38:19","date_gmt":"2022-09-24T05:38:19","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/keyword-javascript\/"},"modified":"2022-09-24T05:38:19","modified_gmt":"2022-09-24T05:38:19","slug":"keyword-javascript","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/keyword-javascript\/","title":{"rendered":"KeyWord Javascript"},"content":{"rendered":"<p>If i have inline JS like this, what keyword i must input to Flying script to delay this js? Thankyou.<\/p>\n<pre><code>&lt;div class=&quot;adace-loader adace-loader-&lt;?php echo esc_attr( $unique_id );?&gt;&quot;&gt;\n\t\t&lt;script&gt;\n\t\t\t(function ($) {\n\t\t\tvar $self = $(&#039;.adace-loader-&lt;?php echo esc_attr( $unique_id );?&gt;&#039;);\n\t\t\tvar $wrapper = $self.closest(&#039;.adace-slot-wrapper&#039;);\n\n\t\t\t&quot;use strict&quot;;\n\t\t\tvar adace_load_&lt;?php echo esc_attr( $unique_id );?&gt; = function(){\n\t\t\t\tvar viewport = $(window).width();\n\t\t\t\tvar tabletStart = &lt;?php echo esc_attr( $tablet_start );?&gt;;\n\t\t\t\tvar landscapeStart = &lt;?php echo esc_attr( $landscape_start );?&gt;;\n\t\t\t\tvar tabletEnd = &lt;?php echo esc_attr( $tablet_end );?&gt;;\n\t\t\t\tvar content = &#039;&lt;?php echo esc_attr( $content );?&gt;&#039;;\n\t\t\t\tvar unpack = true;\n\t\t\t\tif(viewport&lt;tabletStart){\n\t\t\t\t\t&lt;?php\n\t\t\t\t\tif( strpos( $html, &#039;adace-hide-on-mobile&#039; ) ) {\n\t\t\t\t\t\techo &#039;unpack = false;&#039;;\n\t\t\t\t\t}\n\t\t\t\t\t?&gt;\n\t\t\t\t\tif ($wrapper.hasClass(&#039;.adace-hide-on-mobile&#039;)){\n\t\t\t\t\t\t$wrapper.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(viewport&gt;=tabletStart &amp;&amp; viewport&lt;landscapeStart){\n\t\t\t\t\t&lt;?php\n\t\t\t\t\tif( strpos( $html, &#039;adace-hide-on-portrait&#039; ) ) {\n\t\t\t\t\t\techo &#039;unpack = false;&#039;;\n\t\t\t\t\t}\n\t\t\t\t\t?&gt;\n\t\t\t\t\tif ($wrapper.hasClass(&#039;.adace-hide-on-portrait&#039;)){\n\t\t\t\t\t\t$wrapper.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(viewport&gt;=landscapeStart &amp;&amp; viewport&lt;tabletEnd){\n\t\t\t\t\t&lt;?php\n\t\t\t\t\tif( strpos( $html, &#039;adace-hide-on-landscape&#039; ) ) {\n\t\t\t\t\t\techo &#039;unpack = false;&#039;;\n\t\t\t\t\t}\n\t\t\t\t\t?&gt;\n\t\t\t\t\tif ($wrapper.hasClass(&#039;.adace-hide-on-landscape&#039;)){\n\t\t\t\t\t\t$wrapper.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(viewport&gt;=tabletStart &amp;&amp; viewport&lt;tabletEnd){\n\t\t\t\t\t&lt;?php\n\t\t\t\t\tif( strpos( $html, &#039;adace-hide-on-tablet&#039; ) ) {\n\t\t\t\t\t\techo &#039;unpack = false;&#039;;\n\t\t\t\t\t}\n\t\t\t\t\t?&gt;\n\t\t\t\t\tif ($wrapper.hasClass(&#039;.adace-hide-on-tablet&#039;)){\n\t\t\t\t\t\t$wrapper.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(viewport&gt;=tabletEnd){\n\t\t\t\t\t&lt;?php\n\t\t\t\t\tif( strpos( $html, &#039;adace-hide-on-desktop&#039; ) ) {\n\t\t\t\t\t\techo &#039;unpack = false;&#039;;\n\t\t\t\t\t}\n\t\t\t\t\t?&gt;\n\t\t\t\t\tif ($wrapper.hasClass(&#039;.adace-hide-on-desktop&#039;)){\n\t\t\t\t\t\t$wrapper.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(unpack) {\n\t\t\t\t\t$self.replaceWith(decodeURIComponent(content));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($wrapper.css(&#039;visibility&#039;) === &#039;visible&#039; ) {\n\t\t\t\tadace_load_&lt;?php echo esc_attr( $unique_id );?&gt;();\n\t\t\t} else {\n\t\t\t\t\/\/fire when visible.\n\t\t\t\tvar refreshIntervalId = setInterval(function(){\n\t\t\t\t\tif($wrapper.css(&#039;visibility&#039;) === &#039;visible&#039; ) {\n\t\t\t\t\t\tadace_load_&lt;?php echo esc_attr( $unique_id );?&gt;();\n\t\t\t\t\t\tclearInterval(refreshIntervalId);\n\t\t\t\t\t}\n\t\t\t\t}, 999);\n\t\t\t}\n\n\t\t\t})(jQuery);\n\t\t&lt;\/script&gt;\n\t&lt;\/div&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-16039522","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16039522","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\/16039522\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16039522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}