javascript - Uncaught SyntaxError with day countdown script -
so have script got website, modified best of limited js knowledge. surprisingly did not work, gave error on line i'll highlight. here's script put inside of html:
<script> var before = "event before" var current = "today date set in countdown" var montharray = new array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec") function countdown(yr, m, d) { var today = new date() var todayy = today.getyear() if (todayy < 1000) todayy += 1900 var todaym = today.getmonth() var todayd = today.getdate() var todaystring = montharray[todaym] + " " + todayd + ", " + todayy var futurestring = montharray[m - 1] + " " + d + ", " + yr var difference = (math.round((date.parse(futurestring) - date.parse(todaystring)) / (24 * 60 * 60 * 1000)) * 1) if (difference == 0) document.getelementbyid("days").innerhtml = "0"; else if (difference > 0) document.getelementbyid("days").innerhtml = +difference + ; } //enter count down date using format year/month/day countdown(2015, 01, 01) </script>
it's supposed replace contents of bold tag inside paragraph, apparently issue actual script , not id or function.
any appreciated:)
else if (difference > 0) document.getelementbyid("days").innerhtml = difference;
Comments
Post a Comment