<?php
if($_GET["opp"]=="getjosn")
{
//$a=array("title"=>"jjss");
echo '{ "questionid":"1178",
"title":"quick speach888",
"a":"1995yeahs",
"b":"ten words",
"c":"",
"d":"",
"userid":"0",
"right":"1",
"username":"",
"categoryid":"1",
"color":"red",
"tsjifen":"0",
"catelog_id":"29",
"is_pass":"1",
"flag":"0"}';
//echo json_encode($a);
exit;
}
?>
<script language=javascript src="jquery.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
$(document).ready(function() {
$.ajax({
type: "get",//使用get方法访问后台
dataType: "json",//返回json格式的数据
url: "json.php?opp=getjosn",//要访问的后台地址
success: function(msg){
alert(msg.title);
}
})
})
//-->
</SCRIPT>