www.webdeveloper.com

Search:

Type: Posts; User: grendall

Search: Search took 0.04 seconds.

  1. I think I should not check these responses when...

    I think I should not check these responses when I'm very tired, haha!

    I take back my questions, I now get what you were trying to convey in your sample. Thanks for your help!
  2. Oh, I take it back, I was thinking of a different...

    Oh, I take it back, I was thinking of a different sample I had elsewhere.

    My question for you is that your Person.prototype definition used variables like _firstName and _lastName. Can you tell...
  3. Thanks for responding. I have to say though your...

    Thanks for responding. I have to say though your response confuses me. I was creating a constructor that passed two parameters -- firstName and lastName, but your example did away with that.

    Can...
  4. Asking for help on simple Javascript code regarding Inheritance

    function Person(firstName, lastName) {
    var _firstName = firstName;
    var _lastName = lastName;

    Person.prototype.__defineGetter__("firstName", function() {
    ...
  5. Tcobb, I found the solution. This will act as a...

    Tcobb, I found the solution. This will act as a real OOP data model as people would do in Java, C#, etc. It respects private and public properties and methods, as well as the use of getters/setters:...
  6. Tcobb, thank you for your continued response in...

    Tcobb, thank you for your continued response in trying to help me.

    I'm really confused. I come from Java, and all I'm trying to do is create a class that behaves properly as an OOP class. All I...
  7. Thanks for responding, Tcobb. I guess I didn't...

    Thanks for responding, Tcobb.

    I guess I didn't phrase my question correctly, my apologies. I knew the 'p' instance had no properties. But if you look at my code, I did use Object.defineProperty to...
  8. Asking for help with very short code excerpt: Why is the last line saying 'undefined'

    function Person(firstName) {
    var _firstName = firstName;
    };

    Object.defineProperty(Person, "firstName", {
    get: function() {
    return this._firstName;
    },
    set:...
  9. Thank you for responding, tech_soul8, your...

    Thank you for responding, tech_soul8, your explanation was very clear, and I understand now!
  10. Can someone help me understand the usage of "new Function()" please?

    I was reading a book, and it shows this:

    sayMessage = new Function(" console.log(\" Default message\");"); sayMessage(" Hello!");

    When run, it actually results in "Default message" being...
  11. Thank you for responding, Tcobb. I understood...

    Thank you for responding, Tcobb.

    I understood the first half of your sample, but I have a question on the second half (i.e., your makePerson() function). I noticed you created a var y={} and...
  12. Is this a proper Javascript data model class?

    My sample is a Person class with two properties -- first name and last name. What I have done does not resemble exactly as explained in any books I've read, but it somehow works for me because the...
Results 1 to 12 of 12
HTML5 Development Center



Recent Articles