STEP3-1.Ajaxを使ってみる Ajaxとは、JavaScriptなどからHTTP通信をすることによって、ページのリロードをせずにサーバとデータのやり取りをする技術です。ここでは1秒ごとに自動で再読み込みを行うような簡単なチャットを作成してみます。 まずはAjaxで取得するデータを用意しましょう。データはSTEP1で作成した掲示板のデータを流用することにします。以下の内容をajax_get_data.phpという名前で保存します。今回はCakePHPは使用しませんのでhtdocsに保存してください。 <?php $mysqli = new mysqli('localhost', 'root', '', 'board'); $json = array(); $result = $mysqli->query("SELECT * FROM datas ORDER BY created DE