$(document).ready(function() { $.each($(".dymanic_load"),function(){ $(this).load($(this).attr("path"), function(respText,textSta,XML){ if(textSta == 'error') {$(this).html("Loading Failed");} }); } ); });