Get parent class property
<p>I have a javascript class that has a method that uses jQuery to send an Ajax request and handle the response.</p>

<p>The problem I am having is that I can't figure out how to get the properties of the initial, parent class from within the jQuery functions. I have tried <code>$(this).parent()</code> but this doesn't get what I need for some reason.</p>

<p>My code is below. Can anyone tell me how to get to the base class from this loop?</p>

<pre><code>function companiesPage()
{
    this.childCategoriesSelectid = '#childCategoryid';

    this.setChildCategories = function()
    {
        $.ajax({
            url: this.url,
            dataType: 'json',
            success: function(data)
            {
                $.each(data.childCategories, function()
                {
                    $($(this).parent().childCategoriesSelectid)//problem here
                    .append(
                        $('&lt;option&gt;&lt;/option&gt;')
                        .attr('value', this.childCategoryid)
                        .text(this.name)
                    );
                });
            }
        });
    }
}
</code></pre>
