Calling object inside of jquery function?

Calling object inside of jquery function?

Hi,
I am having a question about this and that and so on. As you can see i have my modal object beneath and i'm having a problem dealing with "this" inside the jquery ajax function. As you see i want to update the modal_content inside of the jquery ajax function but can't do that because "this" points to the specific jquery function and not the object the jquery functions is in, i tried to declare "that" as "this" but that didn't work either.

Hopefully you can understand my description but if not please check the code it may help. English is not my main language.

Thanks!

  1.     function ui_modal(){
            this.modal_title         = null;
            this.modal_content   = null;
            this.that                    = this;
            
            this.set_content = function(modal_content){
                this.modal_content = modal_content;
            };
            
            this.load_content = function(url){
                /*$.getJSON(url, function(data){
                    that.modal_content = data.content;
                });*/
                $.ajax({
                    url: url,
                    async: false,
                    dataType: 'json',
                    success: function(data) {
                            self.modal_content = data.content;
                    }
                });

            };





















  2. }