How to print the letters Loading… one by one in jquery or php? [closed]

This script should work for you. (Place it where you want the text to go).

      var text="Loading";

      var scripts = D.getElementsByTagName('script');
      var this_script = scripts[scripts.length - 1];

      var container = D.createElement('span');
      this_script.parentNode.insertBefore(container, this_script);

      (function next(i){
          container.innerHTML += text[i] + ' ';
          if(++i < text.length)
              setTimeout(function(){ next(i); }, 1000);

Leave a Comment