خرید بک لینک

Vote count: 0

Using firebug it keeps stating that this.speak is not defined and I don't understand why that is.I am trying to output it to the screen

 $(document).ready (function() {


    function person(rank, number, id) {
        //properties
        this.intRank = rank;
        this.intNumber = number;
        this.strId = id;
        this.elOutput = document.getElementById(id);
        //methods
        this.speak = fucntion(); {
            this.elOutput.ierHTML += "<br>" + this.strId;
        };

        //adds one to int number and speaks message
        this.pickUpNumber = function() {
            this.intNumber++;
            this.strId = "i have" + this.intNumber.toString() + "rocks";
            this.speak();
        };
    };

    //object

    var Jak = new person(5, "hey ,jack", " Captain");
    var Cap = new person(3, "yea cap?", "jacko");

    jak.speak(); cap.speak(); jak.pickUpRock();

});

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 10 خرداد 1395 ساعت: 7:25

صفحه بندی