Tuesday, 15 January 2013

internet explorer 8 - javaScript Dynamic date not working in IE8 -



internet explorer 8 - javaScript Dynamic date not working in IE8 -

i using below script generate dynamic date.

below code.

the html:

<span id="spandate"></span>

the script:

var months = ['01','02','03','04','05','06','07', '08','09','10','11','12']; var tomorrow = new date(date.now()); document.getelementbyid("spandate").innerhtml = ('00' + tomorrow.getdate()).slice(-2) + "/" + months[tomorrow.getmonth()] + "/" + tomorrow.getfullyear();

fiddle demo link

it working fine on browsers, date not displaying on standalone ie8. works while alter browser mode ie9/10 ie8, somehow not working in actual ie8.

date.now() doesn't work on ie-8! think thats problem.

javascript internet-explorer-8

No comments:

Post a Comment