My javascript isn’t loading after the ajax generated code is called.
Jquery
$(function() {
$('div#lightBoxCloseButton').click(function() {
$('div.lightBoxCon').hide();
});
});
Ajax Code
if($ajax == true)
{
$q = mysql_query("SELECT users.`id`, users.`firstname`, .users.`lastname` FROM users WHERE users.`username`='${u}'");
$r = mysql_fetch_assoc($q);
$displayName = ucwords("${r['firstname']} ${r['lastname']}");
?>
<script type="text/javascript" src="../assets/js/lightbox.js"></script>
<div class="lightBoxCover" id="lightBoxCover"></div>
<div class="lightBoxCon">
<div class="css3Lightbox" >
<div class="closeCross" id="lightBoxCloseButton"></div>
<div class="css3LbBorder1">
<div class="css3LbBorder2">
<h1>
<?php echo "${displayName}'s personal partners";?>
</h1>
<?php
// $partnersQ = mysql_query("SELECT `partners`.`userId2`, `users`.`id`, `users`.`firstname`, `users`.`lastname`, `users`.`imagename` FROM users, partners WHERE `partners`.`userId1` = '${r['id']}'")
// $numrows = mysql_num_rows($partnersQ);
// if($numrows > 0)
// {
// echo "${displayName} currently has ${numrows} personal partners";
echo "${displayName} currently has 2 personal partners";
// while($partnersR = mysql_fetch_assoc($partnersQ))
// {?>
<ul class="partnersList">
<li>
<div class="aviSmall">
<!--<img src="/assets/img/avatars/DeS8nbh3.jpeg" />-->
</div>
</li>
<li>
<div class="aviSmall">
<!--<img src="/assets/img/avatars/test.jpg" />-->
</div>
</li>
</ul>
<?php
// }
// }
// else
// {
// echo "${displayName} currently has no personal partners";
// }
?>
</div>
</div>
</div>
</div>