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);
});
});
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn