Peanuts
Peanuts

Reputation: 2681

How to check if jQuery load() is empty?

Does anyone knows how to check if this jQuery load() function is empty:

    jQuery(this).children('.content-from-far-away').load(URLvar +' .content-item:first-child');

Thank you.

Upvotes: 1

Views: 306

Answers (1)

Dong Nguyen
Dong Nguyen

Reputation: 61

Hope useful for you.

var element = jQuery(this)
             
if (element)
{
  //you can use the load function here without undefined or something like that
   element = elment.children('.content-from-far-away')
                   .load(URLvar +' .content-item:first-child'); 


}

Upvotes: 1

Related Questions