IT_INFOhUb
IT_INFOhUb

Reputation: 516

How to check div tag contains partial view?

As we know window.onload event will fire only when the page is completely loaded.

I want to perform some action when a partial view loaded completely into div tag how to check that? like : $('divID').__ ??

Upvotes: 0

Views: 246

Answers (1)

Moby's Stunt Double
Moby's Stunt Double

Reputation: 2550

You need something like:

$('#divID').ajaxComplete(function(){
    // do something
});

That is of course providing I am correct in my assumption: that you are using both AJAX to populate the DIV and also the Unobtrusive Ajax library rather than the Microsoft MVC Ajax libraries.

If the Partial is simply rendered on page load, then $(document).ready(function(){}) will serve you well.

Upvotes: 1

Related Questions