js and php communicate through json data
Example:
php file
echo json_encode(array(array(
'liaotiantiao'=>$liaotiantiao,
'liaotiantiao'=>$liaotiantiao,
'chatuserid'=>$chatuserid,
'chattouserid'=>$chattouserid
)));
Copy code
var obj=eval(val);
alert( obj[0].chatuserid);
});
});