Javascript object method issue
<p>I'm trying to create an object called List. This object has a method add which simply pushes a task object onto this tasks array. I also built a load method to load items from a url.</p>

<p>My issue is I can't seem to reference the add method from within the load method, I get the following error:</p>

<p>Uncaught TypeError: Object # has no method 'add'.</p>

<p>How do I reference the add method from within the load method?  The code I am using is below. </p>

<pre><code>function List(){
    this.tasks = new Array();
    this.add = function(taskItem){
        this.tasks.push(taskItem);
    };
    this.load = function(url){
        $.getJSON(
            url,
            function(data){
                $.each(data, function(key,val){
                    var task = new Task({
                        id:val.pkTaskId,
                        title:val.fldName,
                        status:val.fldStatus
                    });
                    this.add(task);
                });
            }
            );
    }
}

var userList = new List();
userList.load(url)
</code></pre>
