user2583714
user2583714

Reputation: 1149

Run function when another function finishes jQuery

When a page is done refreshing, jQuery event is launched:

$(#id).trigger('reloaded');

'reloaded' is a custom event;

How do i set up a listener , such that, when it is done 'reloading' , i run another function:

I was thinking about this:

$(#id).on('reloaded',function(ev) {
    alert("LAUNCH function");
});

But this doesnt work

Upvotes: 0

Views: 158

Answers (1)

Sebastien
Sebastien

Reputation: 1328

You are missing a quote in your alert()

it should look like this:

$('#id').on('reloaded',function(ev){
            alert("LAUNCH function");

            });

EDIT: quotes in the selector thanks to @Pinocchio

Upvotes: 1

Related Questions