Internet Explorer 的 JavaScript 问题,在 google chrome 中工作正常,但在 ie 中不行,

标签 javascript google-chrome internet-explorer

嗨,我遇到了 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/

相关文章:

javascript - 我怎样才能同步调用这个状态?

javascript - 没有闰日的两个日期之间的差异

CSS 动画无处不在,但在 IE 和 Edge 中不行?

javascript - html canvas动画卡顿

java - 检查浏览器是否已关闭

html - Flowplayer 在 IE9 中找不到视频,在 IE8 及以下版本中找不到不支持的视频

javascript - AngularJS - 在表中使用指令 - ng-repeat 影响性能

javascript - JQuery 将 RSS feed 限制为 4 个项目

javascript - 如何在选项卡切换 Google Chrome 扩展上获取新 URL?

android - 强制 WebChromeClient 而不是 WebViewClient