Forum Moderators: open

Message Too Old, No Replies

jquery, two or mor div

         

Lolalola

1:18 pm on Jul 18, 2009 (gmt 0)



hi, i use AJAX, framework - JQUERY.
Now all information show in one table( <div id = "user">).

var user= setInterval(function()
{
$('#user).load(user.php?id='+ Math.random());
}, 5000);

user.php:

$rez= mysql_query($sql, $db) or die("Error");
while($r = mysql_fetch_array($rez, MYSQL_ASSOC )){
$name= $r["name"];
$time= $r["time"];


But how make this:

$name show in div name, and $time show in div time.
One file, and two <div>
I hope to understand my trouble

whoisgregg

5:13 pm on Jul 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure exactly how jQuery works, but if you return a JSON encoded [php.net] array from the PHP file, you should be able to get the different values with your javascript.