We have code that loads html to div with class content. We have div element with link class which has data-href and some other data-\* properties. The code looks like:

```
$(document).on('click', '.link', linkClick);
linkClick: function (event) {
            event.stopPropagation();
            $('.content').load($(this).data('href'), function (response, status) {
                if (status == 'error') {
                    $('.content').html("Something went wrong. Please try again later");
                }
            });
        }

```

I want to access $(this) inside this callback of load function to get values of all other data-\* properties of link clicked, how can i do that?
['https://Stackoverflow.com/questions/43979563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4930231/']
Create a scoped reference to it before the load call:

```
function (event) {
    event.stopPropagation();

    var $that = $(this); // <- Like this

    $('.content').load($(this).data('href'), function (response, status) {

        // You can use $that here

        if (status == 'error') {
            $('.content').html("Something went wrong. Please try again later");
        }
    });
}

```
```
$(document).on('click', '.link', linkClick);
var href = $(this).data('href');
linkClick: function (event) {
    event.stopPropagation();
    $('.content').load(href, function (response, status) {
        if (status == 'error') {
            $('.content').html("Something went wrong. Please try again later");
        }
    });
}

```