jquery - Issue displaying javascript on website -


i've been given javascript colleague (who uncontactable) , want know how display number javascript creating on web page. i've loaded javascript using

<script language=javascript src="https://www.mywebsite.com/java/counter.js"></script> 

however don't know html use give me result.

var currstr = 0; var targetstr = 0; var animtimer = null;  $(document).ready(function() {     currstr = calculatecups();     $('.tea-count > .figure').html(currstr.tostring().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));      setinterval(anim, 1000); });  function anim() {     targetstr = calculatecups();      animtimer = setinterval(function()     {         if (currstr < targetstr) {             currstr += 155;              $('.tea-count > .figure').html(currstr.tostring().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));         }          if (currstr >= targetstr) {             clearinterval(animtimer);         }     }, 25);    }  function calculatecups() {     var cupsnumber = 165000000;     var date = new date();     var hours = date.getutchours()*60*60;     var minutes = date.getutcminutes()*60;     var seconds = date.getutcseconds();      return math.round((cupsnumber/86400)*(hours+minutes+seconds)); } 

your appreciated!

you ask friend or add end of webpage before closing </body> tag:

<script>your code</script>


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -