$data = array("order_table" => $order_table,"html"=>$html);
html是table表格html代码
通过js
eval("(" + xmlHttp.responseText + ")");之后,有时候html变量成空值,order_table却没有,在php情况下:
$data = json_decode($data);
print_r($data );html也是空值!这是为什么呢????一下午没解决.....那位高手帮忙指点
调试欢乐多
你的 $data 不过是一个 php 数组,$data = json_decode($data); 如何能得到结果?
$request = $this->getRequest();
$layout = $this->_helper->layout();
$layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$menuId = $request->getParam('menuId', null);
if( $menuId > 0 ){
$SQLTool = new MysqlTool();
$con = $SQLTool->getConnect();
if( $con ){
$sqlLineMenu = "select Id FROM menubar where Type=0";
$resultMenu = mysql_query($sqlLineMenu);
$rowMenubar = mysql_fetch_array($resultMenu,MYSQL_ASSOC);
$menubarId = $rowMenubar['Id'];
// remove his children
$this->callBackMenuitemDelete($menuId,$menubarId);
$sqlLine = "DELETE FROM menuitem WHERE Id = " . $menuId;
mysql_query($sqlLine);
mysql_close($con);
echo json_encode(array('message'=>"删除成功"));
}
}else{
echo json_encode(array('message'=>"删除失败"));
}
}
$data = array("order_table" => $order_table,"html"=>$html);
exit(json_encode($data));