嗨,我遇到了 ie 不显示我的 javascript 的问题,我有点困惑,因为它在 google chrome 中工作正常。我已经尝试过 f12 调试并启用了 javascript,但没有任何运气,所以任何帮助将不胜感激。在 chrome 中它显示正确的天数,在 ie 中它只显示 NaN。
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countup(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 paststring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
difference+=" days"
document.write("<span style=\"color:#A4A4A4;font-size: 3em; \"> It\'s been "+difference+" since the last incident.<\/span>")
}
//enter the count up date using the format year/month/day
countup('<?php echo $date1; ?>')
最佳答案
实际上是什么<?php echo $date1; ?>
返回?因为看起来像countup
需要 3 个参数,但只需要 1 个。
关于Internet Explorer 的 JavaScript 问题,在 google chrome 中工作正常,但在 ie 中不行,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35664138/