I've got the following which works fine in Chrome:
function funLoad(str1,str3,str4)
{
var dym1 = str1.split("/");
var d=new Date();
var dym2 = d.getMonth() + 1 + " " + d.getDate() + " " + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":00";
//var dym2 = "6 10 2013 09:00:00";
var start = Date.parse(dym1[1] + " " + dym1[0] + " " + dym1[2] + " " + str3 + ":" + str4 + ":00");
var end = Date.parse(dym2);
return (start-end) / (1000*60*60);
}
$("#btn1").click(function(event){
alert(funLoad($("#txt1").val(),$("#ddlHourTime").val(),$("#ddlMinuteTime").val()));
});
Here is a jsFiddle:
http://jsfiddle.net/oshirowanen/QTVWd/6/
When I run this in IE8, I just get alerted with NaN
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…