www.webdeveloper.com
Results 1 to 3 of 3

Thread: no ie support

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    no ie support

    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>

  2. #2
    Join Date
    Oct 2008
    Location
    U.S.
    Posts
    726
    Syntax error - this document.write() ends at the ); and the line below it is causing syntax error because it's just kinda 'there':
    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);

  3. #3
    Join Date
    Nov 2008
    Posts
    2

    rply

    oh wow how did i leave that there...i had put that in as like a clipboard so i can copy it later...i must have left it there...i removed that line that want supposed to be there in the first place...not it works like a charm...now i need to fix the css for IE but im used to that it shouldnt be that hard lol....


    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles