如何返回Ajax调用结果

Magento风格的Ajax请求及回应

发出Ajax请求
Magento集成prorotype作为自己的页面js框架,所以发出ajax请求即prototype风格的,如:
<script type="text/javascript">
//<![CDATA[
function fetch_design() {
  new Ajax.Updater('html-block', '<?php echo $this->getUrl("review/product/list/" , array("id"=>"{$_product->getId()}","category"=>"{$_product->getCategoryId()}")) ?>',
    { method:'get',
      onLoaded: function(transport, json){
      }
    });
}
//]]>
</script>



返回Ajax请求
请参见 http://koda.iteye.com/blog/640035

你可能感兴趣的:(JavaScript,PHP,json,Ajax,prototype)