title: WP: Enqueue JS at very end of the loading site
body: <p>I've got a script, which changes div's placement a little. To work fine, it must be loaded at very end of the page loading - it's because my WP page have few different plugins, some of them uses the js to display content on page, and moving that content is what I want to achieve.</p>
  
  <p>I've tried to put 999999 priority to add_action parameter, also tried to cheat with js function settimeout, but that's not the point - it must work every time, and my "solutions" didn't provide me that. There was always some linked scripts which were loaded later than mine, timeout works sometimes, but only sometimes...</p>
  
  <p>Plugins which i think could collide: Woocommerce, Easy FancyBox, Instagram Feed.</p>
  
  <p>Thx for help!</p>
  
  <p>[EDIT]</p>
  
  <p>So, i need to change this:</p>
  
  <pre><code>&lt;div class="foo"&gt;
      &lt;div class="bar"&gt;
          &lt;div class="destination"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="origin"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>&lt;div class="foo"&gt;
      &lt;div class="bar"&gt;
          &lt;div class="destination"&gt;
              &lt;div class="origin"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My js code is:</p>
  
  <pre><code>var from = document.getElementsByClassName("origin");
  jQuery("window").on("load",function(){
      jQuery.each(from, function(i, el) {
          jQuery(el.parentNode.parentNode).find(jQuery(".destination"))[0].appendChild(el);
      });
  });
  </code></pre>
  
  <p>And only what i need is to load it up last after all js files.</p>
  
  <p>Also, the function which works sometimes looks that:</p>
  
  <pre><code>var from = document.getElementsByClassName("origin");
  setTimeout(function() {
      jQuery.each(from, function(i, el) {
          jQuery(el.parentNode.parentNode).find(jQuery(".destination"))[0].appendChild(el);
      });
  },1);
  </code></pre>