Besides the above code, consider creating an array or a json object to store the notifications in the notify system. That way the $(document).ready()
function is not called in every cycle of the while loop:
<script type="text/javascript">
var notifications = {};
<?php
// while, if, etc
{
?>
notifications.push({text: "the name is <?php echo $name; ?>", stay: true});
<?php
}
?>
$(document).ready(function(){
for(notif in notifications){
jQuery.noticeAdd({
text: notif.text,
stay: notif.stay
});
}
});
</script>
or something like that