How to deal with the new Date () Problem under ie8, dateie8
<Script> function getDays (strDateStart, strDateEnd) {var strSeparator = "-"; var oDate1; var oDate2; var iDays; oDate1 = strDateStart. split (strSeparator); oDate2 = strDateEnd. split (strSeparator); var strDateS = new Date (oDate1 [0], oDate1 [1]-1, oDate1 [2]); var strDateE = new Date (oDate2 [0], oDate2 [1]-1, oDate2 [2]); iDays = parseInt (Math. abs (strDateS-strDateE)/(1000*24*3600) return iDays;} alert (getDays ('2017-02-26 ', '2017-08-18') </script>
For the setDate () Problem in IE8, open a browser and prompt that the object does not support this problem. How can this problem be solved?
Try to find the webpage or plug-in represented by cal first.
It is best to use document. getElementById
Check whether the parent window can be obtained.
Judge gradually before proceeding to the next step
New Date ();
Java will automatically destroy unnecessary objects. If it is C ++, You need to manually release space in the destructor.