Commit 48a861dc authored by Markus Bergt's avatar Markus Bergt

added real logic to update

parent 0e010bcf
...@@ -8,7 +8,14 @@ $(document).ready(function() { ...@@ -8,7 +8,14 @@ $(document).ready(function() {
function UseData(data){ function UseData(data){
var obj = jQuery.parseJSON(data); var obj = jQuery.parseJSON(data);
alert(obj.UsersTable); if(!!obj.UsersTable)
{
$('#onlineStatus').innerHTML(obj.UsersTable);
}
if(!!obj.newMessages)
{
$('#chatbody').append(obj.newMessages);
}
} }
$('#showRegBtn').click(function(){ $('#showRegBtn').click(function(){
......
...@@ -60,14 +60,14 @@ else{ ...@@ -60,14 +60,14 @@ else{
</div> --> </div> -->
<table class="table"> <table class="table" id="onlineStatus">
<?php echo UserTable();?> <?php echo UserTable();?>
</table> </table>
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-10 col-xs-offset-0 col-sm-offset-3 col-md-offset-3 col-lg-offset-2"> <div class="col-xs-12 col-sm-9 col-md-9 col-lg-10 col-xs-offset-0 col-sm-offset-3 col-md-offset-3 col-lg-offset-2" id="chatbody">
<?php <?php
$result = mysql_query("SELECT MAX(id) AS id FROM chat"); $result = mysql_query("SELECT MAX(id) AS id FROM chat");
$chat = mysql_fetch_array($result); $chat = mysql_fetch_array($result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment