Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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ÖÐʹÓÃSimpleTest½øÐе¥Ôª²âÊÔ

      SimpleTestÊÇÒ»¸öʹÓÃÊ®·Ö¼òµ¥µÄµ¥Ôª²âÊÔ¹¤¾ß¡£
      Ò»ÏÂÄÚÈÝÊÇÎÒ×Ô¼ºÉè¼ÆµÄÀûÓÃSimpleTest¶ÔÒ»¸öÏîÄ¿½øÐе¥Ôª²âÊԵĴúÂë
Ò»¡¢Îļþ½á¹¹
      Ò»¸öÏîÄ¿Óжà¸öÎļþ¼Ð£¬Îļþ¼ÐÖл¹°üº¬Îļþ¼Ð¡£ÎÒÃÇÒª½øÐвâÊԵĴúÂë¼´°üº¬ÔÚÕâЩÎļ ......

Symfony:php¿ò¼ÜϵÁÐ֮ǿ´óµÄSymfony

SymfonyÊÇÒ»¸öÈ«¹¦ÄܵÄPHP¿ª·¢¿ò¼Ü£¬¿ª·¢ÓïÑÔΪPHP5.ËüÏò³ÌÐòÔ±ÌṩÁËÁ¼ºÃµÄ¼Ü¹¹£¬³£ÓõŦÄÜ×é¼þ¼°¹¤¾ß£¬¿ÉÓÃÓÚ¿ìËÙ´´½¨¸´ÔÓµÄWEB³ÌÐò¡£Ñ¡ÔñSymfony¿ÉÒÔÈÃÄã¸ü¿ìµØ·¢²¼ÄãµÄ²úÆ·£¬²¢ÇÒºÜÈÝÒ×ÔËÓªºÍÀ©Õ¹¡£SymfonyµÄÍŶӺÜÓо­Ñ飬²»Öظ´·¢Ã÷ÂÖ×Ó£ºËüʹÓÃÁ˺ܶàWEB¿ª·¢Öеē×î¼Ñʵ¼ù”²¢¼¯³ÉÁËһЩÓÅÐãµÄµÚÈý·½Àà¿ ......

AJAXʵÏÖloading¡­.Ч¹û

ÂÌɫͨµÀÎļþ¶¼ÊÇ×ßÅú£¬Ò»¸öÎļþ×ßÍêÁ÷³Ìºó£¬ÔÙ²éѯ£¬ËÙ¶ÈÕæÊÇÂý£¬Òª·Ö±ð´Ó5¸ö±í²é£¬²¢ÇÒÐèÒªÉèÖùØÁª²éѯ£¬Òò´ËÔÚÌá½»Êý¾Ýºó£¬ÎÒÏ£Íû²éѯÕⲿ·Ö¿ÉÒÔÓÃAJAXʵÏÖ£¬µ±Êý¾Ýδ·µ»ØÊ±£¬DIVÀïÏÔʾһ¸ö¼ÓÔØGIF£¬µÈÊý¾Ý·µ»ØºóÔÙÏÔʾÌá½»µÄÊý¾Ý¡£¶øÖظ´²éѯʱҲ²»»áÔÙÌá½»Êý¾ÝºÍË¢ÐÂ,½ÚÊ¡Á˺ܶà×ÊÔ´.
 
   ËäÈ»ÎÒ»á ......

JSONÀý×Ó£¨struts ajax json£©

À´Ô´£ºhaoxuewu - BlogJava
¡¡¡¡Ç°¶Îʱ¼ä×öÏîÄ¿Óõ½ÁËjson£¬½ñÌìÎÒ³éʱ¼äдÁËÒ»¸östruts+ajax+jsonµÄÀý×Ó.
¡¡¡¡¸öÈ˸оõajax+jsonÔںܴó³Ì¶ÈÉϽµµÍÁËÍøÂçºÍ·þÎñÆ÷µÄIO£¬ÊÇÒ»¸öºÜ²»´íµÄ×éºÏ£¡
¡¡¡¡1£ºjsonµÄlibÎÒÓõÄÊÇjson-lib-2.1-jdk15.jar£¬Ëü¿ÉÒÔÔÚ
¡¡¡¡2£ºstrutsÓõÄÊÇ1.2
¡¡¡¡3£ºÓõ½ÁËjsµÚÈý·½prototype.js£¬Ö÷ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ