Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    An Object Lesson In JavaScript


    An Object Lesson In JavaScript This was a great one!
    Thank you guys!
    :) You can read the article here .
  2. #2
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Invalid Leap Year Fix


    <p><pre><font color=#008000><xmp>

    // leap year correction
    if (this.year % 4 == 0)
    {
    this.totalDays[1] = 29;
    }

    </xmp></font></pre><p>
    <!-- Code -->
    <p><pre><font color=#008000><xmp>

    // leap year correction
    if (this.year % 4 == 0)
    {
    if (this.year % 100 == 0)
    {
    if (this.year % 400 == 0)
    {
    this.totalDays[1] = 29;
    }
    }
    else
    {
    this.totalDays[1] = 29;
    }
    }

    </xmp></font></pre><p>
  4. #3
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Invalid Leap Year Fix


    The last else statement seems to be unnecessary in Serge's code.

    I would do this using Date object (d is a Date object):

    Code:
    function getDaysInMonth(d)
    {
    	fullYear = (d.getYear() < 1900) ? d.getYear() + 1900 : d.getYear();
    	dCopy = new Date(fullYear, d.getMonth(), 1);
    	dCopy.setMonth(d.getMonth() + 1);
    	dCopy.setDate(0);
    	
    	return dCopy.getDate();
    }
  6. #4
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Great


    A really clear, good introduction. Thanks.
  8. #5
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Good one


    Well put, simple and clear. A great article.

    Allen
  10. #6
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    comments on this keyword


    Sir,
    I am just polishing my javascript knowledge and i am finding this website cool enough. But i think the keyword "this"
    is not necessary in the following eg. which u have given in one of ur webpages:

    function Working(no1,no2)
    {
    this.half=no1; this.full=no2;
    alert(half+" "+full);
    }

    The same eg works fine without "this" keyword.
    Regards,
    umesh.
  12. #7
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    seLam


    sfafclmfzxpohjc
  14. #8
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Good lesson!


    I enjoyed reading and will enjoy creating my ownset of JS Objs. I would think this is great stuff for stubbing and carrying through design ideas.
  16. #9
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Good lesson!


    Here here! I also really enjoyed this article on javascript. It's really a more useful language than most people give it credit for.
  18. #10
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Calendar JS file


    Good tutorial.

    One comment - in the Calendar JS file, the SCRIPT tags should not be included, right? Since that was my first external JS file include it took me a few hours to debug that.

    Thanks for putting it together.
  20. #11
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Good one


    I liked the article. Easy to understand. Thanks.
  22. #12
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Good lesson


    Thank you for the great lesson on basic javascript oop. I needed a good lesson. Thank you.

    John Reskusich
  24. #13
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Thank You


    I am always amazed by all the free lessons available on line. Thank you for this great tutorial. I will definetly book mark this web site.
  26. #14
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    error!!! on the page


    http://www.devshed.com/Client_Side/JavaScript/Object/page4.html

    after passing the properties the alert images seem to be the same.. it musthave been placed by mistake
    both the alert seem to be showing the same error...both the images are the same as "BETA 89" one must be alpha...
  28. #15
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    object lesson


    terrific, well thought out and informative. As a teacher I appreciate the effort you went to to write this article. I will attempt to write something similar (another topic) for my tudents. Thank you.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo