<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: King是太阳</title>
    <description>The latest articles on DEV Community by King是太阳 (@king_fb561b037550fd9af).</description>
    <link>https://dev.to/king_fb561b037550fd9af</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3920884%2F43d9d2f4-a84c-4911-bee1-f8b58376ac84.jpg</url>
      <title>DEV Community: King是太阳</title>
      <link>https://dev.to/king_fb561b037550fd9af</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/king_fb561b037550fd9af"/>
    <language>en</language>
    <item>
      <title>How should the JS inside a &lt;script async&gt; be written? Does it really not use the DOM?</title>
      <dc:creator>King是太阳</dc:creator>
      <pubDate>Fri, 08 May 2026 23:59:46 +0000</pubDate>
      <link>https://dev.to/king_fb561b037550fd9af/how-should-the-js-inside-a-be-written-does-it-really-not-use-the-dom-5d5k</link>
      <guid>https://dev.to/king_fb561b037550fd9af/how-should-the-js-inside-a-be-written-does-it-really-not-use-the-dom-5d5k</guid>
      <description>&lt;p&gt;Hi, I understand the concept of  in HTML:&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;The script downloads asynchronously&amp;lt;br&amp;gt;
It executes immediately once downloaded&amp;lt;br&amp;gt;
It does not wait for the DOM to finish parsing&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;But I’m confused about something. Some people say that JS loaded with async might be independent of the DOM.&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;I want to know, how should the JS file actually be written? Is it really completely not supposed to use the DOM at all?&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;I know the theory of async, but I don’t know what the JS file inside actually looks like. Could someone give an example of JS that works properly with &amp;lt;script async&amp;gt;?&amp;lt;/p&amp;gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
