Here is the code that i have been working on. Apparently the #layout call is executed first for some reason and it gives undefined as the value.
$(function() {
$(".left").load("PartsList.php", function() {
alert("success");
});
$(".right").load("Custom.php", function() {
alert("success");
});
$("#layout").children().on({
click: function() {
alert($(this).attr('id'));
}
});
});
Thank you for your time :).
That’s because
.load()is called asynchronously.You may bind with
instead