Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Parsing JSON Data from PHP Using jQuery (ajax)

have been studying parsing JSON from PHP using AJAX to display it in
the client side and jQuery had been a great help to me. Here is a very
simple code in parsing JSON using jQuery that i made.
tablejsondata.php
This file makes the request to a php file and displays the returned data into a table.
<html>
<head>
<title>Parsing JSON from PHP Using jQuery</title>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">
</script>
</head>
<body>
<a href="#" id="loaduserdata">User Data</a>
<table id="userdata" border="1">
<thead>
<th>First Name</th>
<th>Last Name</th>
<th>Email Address</th>
<th>City</th>
</thead>
<tbody></tbody>
</table>
<script>
$(document).ready(function(){
});
$("#loaduserdata").click(function(){
$("#userdata tbody").html("");
$.getJSON(
"jsondata
.php
",
function(data){
$.each(data.userdata, function(i,user){
var tblRow =
"<tr>"
+"<td>"+user.first+"</td>"
+"<td>"+user.last+"</td>"
+"<td>"+user.email+"</td>"
+"<td>"+user.city+"</td>"
+"</tr>"
$(tblRow).appendTo("#userdata tbody");
});
}
);
});
</script>
</body>
</html>
jsondata.php
This is the file that contains the JSON data.
<?php
$json = '{
"userdata": [
{
"first":"Ciaran",
"last":"Huber",
"email":"elementum.purus@utdolordapibus.edu",
"city":"Mayagüez"
},
{
"fi


Ïà¹ØÎĵµ£º

php——Êý¾ÝÀàÐÍ£¨1£©

Ô­ÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/02/03/1-10/
ÓëÆäËû±à³ÌÓïÑÔ²»Í¬µÄÊÇ£ºPHPµÄÊý¾ÝÀàÐͲ»ÊÇÓɳÌÐòÔ±ÔÚ¶¨Òå±äÁ¿µÄʱºò¾ö¶¨µÄ£¬¶øÊÇÓÉPHPÔÚ³ÌÐòÔËÐйý³ÌÖж¨Òå¡£
PHP¹²Ö§³Ö8ÖÖÊý¾ÝÀàÐÍ£ºÕûÐÍ£¨integer£©¡¢¸¡µãÐÍ£¨float£©¡¢×Ö·û´®ÐÍ£¨string£©ºÍ²¼¶ûÐÍ£¨Boolean£©ËÄÖÖ±êÁ¿ÀàÐÍ£¬Êý×飨array£©ºÍ¶ÔÏó£¨object£ ......

jQuery Ajax È«½âÎö

jQuery Ajax È«½âÎö
±¾ÎĶÌÖ·£ºhttp://s8.hk/0itq
<!--
.ajax div{
border: solid 1px red;
}
-->
// <![CDATA[
$(function(){

$("#btnajax").click(function(){
$.ajax({
type: "get",
url: "/rss",
beforeSend: function(XMLHttpRequ ......

¼òµ¥Ó¦¸ÃajaxÎÞˢлñÈ¡Êý¾Ý

Ajax¿ÉÒÔʵÏÖÍøÒ³µÄ¾Ö²¿Ë¢ÐÂ,ÊÇͨ¹ýJS»ñÈ¡Êý¾Ý,ÔÙ°ÑÊý¾ÝÌí¼Óµ½ÍøÒ³ÖÐ,È»¶øÓÉÓÚä¯ÀÀÆ÷µÄ²»Í¬,³õѧÕߺÜÄÑ×öµ½¼æÈÝÎÊÌâ.
ÕâÀïÎÒÏò´ó¼Ò½éÉÜÒ»Öֺõķ½·¨.ͨ¹ýJQuery²å¼þ.JQuery.jsÎļþ¿ÉÒÔÔÚ¹ÙÍøÉÏÏÂÔØ,»òÕßgoogleÒ²ÐÐ.
Ê×ÏÈÄãÒªÔÚÍøÒ³ÒýÈëJSÎļþ
<script src="../javascript/jquery.js" type="text/javascript"></ ......

struts2 + jquery + json ½øÐÐajaxÇëÇó

ÏîÄ¿ÖÐÏëÓÃajax
£¬ÓÚÊÇÔÚÍøÉÏ°ÇÁË
n
¶à×ÊÁÏ£¬·¸ÁË
n
¶à´íÎ󣬴ӽñÌìÉϰൽÏÖÔÚÒ»Ö±ÔÚ´¦ÀíÕâ¸öÎÊÌ⣬ÖÕÓÚ»¹ÊÇ°ÑËü½â¾öÁË¡£
 
µ±ÎÒ¿´µ½Ò³ÃæµÄajax
ÏÔʾºó£¬ÎÒÐË·ÜÒì³££¬ÎªÁ˼Ǽ×Ô¼ºÑ§Ï°µÄ
ajax
Àú³Ì£¬Ò²ÎªÁËÈøü¶àµÄÈËÉÙ×ßÍä·£¬ÌØд´ËÒ»ÎÄÒÔ¼ÇÖ®£¡
 
·Ï»°²»ËµÁË£¬ÎªÁ˸üºÃµÄÀí½â£¬ÎÒÖØ×öÁËÒ»¸öСµÄÏî ......

windowsÏÂPHP環¾³´î½¨

http://topic.csdn.net/t/20040927/15/3412922.html
http://www.docin.com/p-23414672.html 
http://www.qqread.com/php/n652282101.html
http://www.51testing.com/?uid-65519-action-viewspace-itemid-142987
1    apacheÅäÖÃÎļþhttpd.conf×îááÌí¼Ó:
LoadModule php6_module "c:/php6/php6apac ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ