一覧表示
一覧表示
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD.xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta HTTP-EQUIVE="Content-Type" CONTENT="text/html;charset=utf-8" />
<title>一覧表示</title>
<!-- 一覧表示 -->
<script src="../js/prototype.js" type="text/Javascript"></script>
<script src="../js/test11.js" type="text/Javascript"></script>
</head>
<body>
<form id=frm name=frm>
<input type=button id=btn1 name=btn1 value="表示"><br />
結果<div id=dispResult></div><br />
</form>
</body>
</html>
<!--
test11.js
//画面の起動時に呼びだされます
Event.observe( window, 'load', dispList );
//呼び出すJSONデータの登録処理をします
function dispList(){
//画面のボタン処理を実装します
Event.observe(
'btn1',
'click',
function()
{
new Ajax.Request
(
'../php/test11.php',
{
method : 'get',
onSuccess : function(httpObject)
{
//受信したJSONデータを画面上の指定に表示します
$('dispResult').innerHTML = httpObject.responseText;
}
}
);
}
);
}
test_11.php
<?php
$html = "";
$html = $html . "<table border=1>";
$html = $html . "<tr>";
$html = $html . "<td style='background-color:lightgreen;'>";
$html = $html . "No";
$html = $html . "</td>";
$html = $html . "<td style='background-color:lightgreen;'>";
$html = $html . "Item";
$html = $html . "</td>";
$html = $html . "</tr>";
$html = $html . "<tr>";
$html = $html . "<td style='background-color:lightyellow;'>";
$html = $html . "1";
$html = $html . "</td>";
$html = $html . "<td style='background-color:lightblue;'>";
$html = $html . "aaa";
$html = $html . "</td>";
$html = $html . "</tr>";
$html = $html . "<tr>";
$html = $html . "<td style='background-color:lightyellow;'>";
$html = $html . "2";
$html = $html . "</td>";
$html = $html . "<td style='background-color:lightblue;'>";
$html = $html . "bbb";
$html = $html . "</td>";
$html = $html . "</tr>";
$html = $html . "</table>";
echo $html;
?>
--------------------------------------------------
-->
|
|