Hi Everyone,

I'd like to use jQuery in a class I'm working on for a project.
However, I'm quickly getting lost in variable resolution, and any help
people could provide would be greatly appreciated.

So, the just of it is that I have something like:

function DB_info(script) {

        this.db_info_script = script;
        this.results = '';

};

and then:

DB_info.prototype.get_column_details = function(obj, table, column) {

        $.post(this.db_info_script,
        {       action: "get_column_details",
                table:  table,
                column: column},
        function(json) {

               // Watch out, here comes the tricky part
                this.parent.results = json;
        },
        "json");

        return true;

}

The tricky part, or the part I'm having trouble with, is how to set
DB_info.results = to the json results of the $.post call.  I realize
that the problem at the tricky part is that "this" at that point is
refering to the jQuery object, but DB_info.results and
DB_info.prototype.results don't seem to work either.

Is there anyway I can pass something through the $.post callback so
that my ajaxComplete listeners can get to that json object?  Or is
there an obvious better way to do be doing all this in the first
place.

Again, thanks all for reading!

Reply via email to