PHP/MySQL 코드를 jgrowl에 구현하는 데 문제가 있습니다.MySQL 테이블에서 행을 가져 와서 JGROWL 알림으로 표시
당신이 으르렁 거리는 소리가 OS X 용 않는 것처럼 알림을 제공하는 알 jgrowl 잘 알고 있다면 내가 내 테이블에서 모든 레코드를 읽을 수 있지만 순간에 그것은 단지 하나 개의 레코드를 표시 얻기 위해 노력하고
통지로서 그것은 그것을 4 번 반복한다.
또 다른 문제점은 테이블에 5 개의 행이 있으면 jgrowl이 4 개의 알림 만 표시한다는 것입니다.
테이블의 모든 레코드를 알림으로 보려면 어떻게해야합니까? 전체 레코드 수 (5)를 알림으로 표시하고 누락 된 레코드를 현재 계정에 기록하려면 어떻게합니까?
<script type="text/javascript">
// In case you don't have firebug...
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
}
(function($){
$(document).ready(function(){
// This specifies how many messages can be pooled out at any given time.
// If there are more notifications raised then the pool, the others are
// placed into queue and rendered after the other have disapeared.
$.jGrowl.defaults.pool = 5;
var i = 1;
var y = 1;
setInterval(function() {
if (i < <?php echo $totalRows_comment; ?>) {
<?php
echo '$.jGrowl("'.$row_comment['comment'].'",';
?>
{
sticky: true,
log: function() {
console.log("Creating message " + i + "...");
},
beforeOpen: function() {
console.log("Rendering message " + y + "...");
y++;
}
});
}
i++;
} , 1000);
});
})(jQuery);
</script>
<p>
</span>
<p>
Growl 코드는 잘 작동하지 않습니다. jquery 섹션을 이해하는 데 어려움이 있습니다. 익숙하지 않습니다. 이 일에 도움이 필요 했어. – methuselah