#1 transcend
----------------------------------------------------------------------------class main extends spController
{
function index(){
$production=spClass("production");
$id= $this->spArgs('p_id'); //这个是从AJAX传过来的
$conditions= array('id'=>id);
$this->cd =$production->findAll($conditions); //怎么把点击事件完以后把这个查询结果传到显示页面中?
$this->nd=$production->findSql("select * from production");
$this->display("home/index.html");
}
-------------------------------------------------------------------------------
var ss =function doLog(str){
var friendid =str
function initXMLHttpRequest3(){
if(window.XMLHttpRequest){ //Mozilla浏览器
http_request=new XMLHttpRequest();
if(http_request.overrideMineType){ //防止某些版本的Mozilla浏览器处理没有Mine Type信息的;内容出错
http_request.overrideMineType("text/xml");
}
}else if(window.ActiveXObject){ //IE浏览器
try{ //IE6或更高版本
http_request=new ActiveXObject("Msxml2.XMLHTTP");
}catch(s){ //IE5.x
http_request=new ActiveXObject("Microsoft.XMLHTTP");
}
}
}
function check3(friendid,opendate){ //初始化XMLHttpRequest
initXMLHttpRequest3(); //设置回调函数
http_request.open("GET","index.php?c=main&a=index&p_id="+friendid,true);
http_request.onreadystatechange=callBack3; //使用AJAX引擎的核心对象发送请求
http_request.send(null);
function callBack3(){ //AJAX引擎在服务器端成功返回后自动调用该函数 //负责将服务器端返回的数据显示在客户的UI上
if(http_request.readyState==4){ //服务器端已经处理完成
if(http_request.status==200){ //服务器端处理成功
document.getElementById("logarea").innerHTML="<{foreach from=$cd item=id}>"+ //在这里显示到页面是空的
'
"
"
"
"
"
"
"
"
"
"<{/foreach}>";
}
}
}
}
----------------------------------------------------------------------
2012-06-09 17:45:04