Khalid Omar
Khalid Omar

Reputation: 2402

Wait until loading content

I'm trying to load a table by jQuery load then zebra the table but the content of table is loaded but the zebra fails. If the page is loaded and the table exists the zebra function works.

$("#processTab").load("URL");

$(".Innertable tr:nth-child(even)").css("background-color", "#eee");

Upvotes: 1

Views: 1467

Answers (1)

Giorgi
Giorgi

Reputation: 30883

You need to zebra your table after the table has been loaded. To detect when the table has been loaded use the callback of the load method.

Upvotes: 3

Related Questions