I did the same mistake again and started developing in Firefox. Only wen I tested in IE did find that the is 0% support for my code. The only problem is that I could not dignose it at all. Because the only functions that I used were: document.write, Math.round, Math.floor, and date. All of those should execute in IE the same way as they do in Firefox. Also let me mention that this is maybe my 2nd or 3rd javascript project, so if I misses some very n00bish thing pardon me.
Code:<script type="text/javascript"> var today = new Date(); var leave = new Date(2008, 9, 31, 15, 5, 0); var arrive = new Date(2009, 1, 27, 14, 30, 0); var timeLeft = Math.round((arrive - today) / 1000); var timePassed = Math.round((today - leave) / 1000); var totalSeconds = 10279500; function funOne(totalSec) { var totalMon = Math.round(totalSec / 60 / 60 / 24 / 30 * 100)/100; var totalWek = Math.round(totalSec / 60 / 60 / 24 / 7 * 100)/100; var totalDay = Math.round(totalSec / 60 / 60 / 24 / 1 * 100)/100; var totalHou = Math.round(totalSec / 60 / 60 / 1 / 1 * 100)/100; var totalMin = Math.round(totalSec / 60 / 1 / 1 / 1 * 100)/100; document.write("Months: <b>" + totalMon + "</b>"); document.write("<br />Weeks: <b>" + totalWek + "</b>"); document.write("<br />Days: <b>" + totalDay + "</b>"); document.write("<br />Hours: <b>" + totalHou + "</b>"); document.write("<br />Minutes: <b>" + totalMin + "</b>"); document.write("<br />Seconds: <b>" + totalSec + "</b>"); } function funTwo(totalSec) { var remainder= 0; var floorMon = Math.floor(totalSec / 60 / 60 / 24 / 30); document.write(floorMon + " Months "); var remainder= totalSec % (60 * 60 * 24 * 30); var floorDay = Math.floor(remainder / 60 / 60 / 24); document.write(floorDay + " Days "); var remainder= remainder % (60 * 60 * 24 * 1); var floorHou = Math.floor(remainder / 60 / 60); document.write(floorHou + " Hours "); var remainder= remainder % (60 * 60 * 1 * 1); var floorMin = Math.floor(remainder / 60); document.write(floorMin + " Minutes "); var remainder= remainder % (60); var floorSec = Math.floor(remainder); document.write(floorSec + " Seconds") } document.write("<h2>Total Time Passed Since I'v Seen Your Beautiful Face</h2>") document.write("<h3>Total . . .</h3>") funOne(timePassed); document.write("<h3>Or in other words . . .</h3>") funTwo(timePassed); document.write("<h2>Total Time Left Till I Get To See That Face Again</h2>") document.write("<h3>Total . . .</h3>") funOne(timeLeft); document.write("<h3>Or in other words . . .</h3>") funTwo(timeLeft); document.write("<br /><br /><b>" + Math.round(timePassed / totalSeconds * 1000000)/10000 + "% Done </b>"); <b>' + Math.round(100 - (timePassed / totalSeconds * 10000))/100 + '% Done </b> var bar = Math.round(timePassed / totalSeconds * 1000); var done = Math.round(timePassed / totalSeconds * 10000)/100; var left = Math.round((100 - done) * 100)/100; document.write('<br /><br /><table cellspacing="0"><tr><td id="left" align="center" width="' + bar + '"><b>' + done + '% Done </b></td><td id="right" align="center" width="' + (1000 - bar) + '"><b>' + left + '% Left </b></td></tr></table>'); </script>


Reply With Quote

Bookmarks