|
 |
|
อยากให้มัน รีเฟส Real-time รีเเค่ส่วนที่เป็น text ต้องแก้ยังไงมั้งหรอครับ |
|
 |
|
|
 |
 |
|
ใช้พวก jQuery กับ Ajax จะง่ายกกว่าครับ ลองดูตัวอย่างนี้ครับ
<!DOCTYPE html>
<html>
<head>
<title>ThaiCreate.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<meta charset=utf-8 />
<script>
function getDataFromDb()
{
$.ajax({
url: "getData.php" ,
type: "POST",
data: ''
})
.success(function(result) {
var obj = jQuery.parseJSON(result);
if(obj != '')
{
var messageid = null;
var subject = null;
$.each(obj, function(key, val) {
messageid = val["MessageID"] ;
subject = val["Subject"] ;
$("#div1").text(subject);
});
showPopup(messageid,subject);
}
});
}
setInterval(getDataFromDb, 10000); // 1000 = 1 second
</script>
</head>
<body>
<center>
<div id="div1"></div>
<center>
</body>
</html>
ทำระบบ Notify Alert ข้อความใหม่ หรือ Notification แบบ Outlook (PHP,MySQL)
|
 |
 |
 |
 |
Date :
2013-07-21 06:48:12 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|