title: Load javascript into div when user scroll position reaches it
body: <p>I want to make the script load into the div only when user reaches it. I am trying to accomplish this using jQuery, but no success. Maybe you can help. Here is the code:</p>
  
  <pre><code>var scrollFromTop = $("#float_div_id").offset().top;
  
  $(document).scroll(function () {
      if ($(this).scrollTop() &gt; scrollFromTop) {
          var s = document.createElement('script');
          s.setAttribute('type', 'text/javascript');
          s.src = 'javascript code src which i want to append on scroll';
          document.getElementById('float_div_id').appendChild(s);
      }
  });
  </code></pre>