데이터베이스에 사용자에게 필요한 사항을 알리는 메시지를 저장하는 테이블을 만들 계획입니다.PHP와 MySQL에서 jQuery Growl 사용하기
나는 jQuery growl을 알림 메서드와 같이 사용하려고하지만 어떻게 작성해야하는지 혼란 스럽다.
데이터는 양식의 표준 MySQL 삽입 방법을 사용하여 데이터베이스에 추가되지만 데이터베이스에서 jQuery를 사용하여 표시 할 메시지를 선택하는 방법은 무엇입니까?
AJAX를 사용해야합니까?
<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 < 3) {
$.jGrowl("Message " + i, {
sticky: true,
log: function() {
console.log("Creating message " + i + "...");
},
beforeOpen: function() {
console.log("Rendering message " + y + "...");
y++;
}
});
}
i++;
} , 1000);
});
})(jQuery);
</script>
<p>
</span>
<p>