日期:2014-05-17 浏览次数:20436 次
<script type="text/javascript">
function cheshi(id) {
$.ajax({
type: "POST",
url: "/tools/admin_ajax.ashx?action=cheshi",
data: { id:id },
dataType: "json",
beforeSend: function (XMLHttpRequest) {
//发送前动作
},
success: function (data, textStatus) {
$("#div1").text(data.word_ename);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$("#div1").text("错误");
}
});
}
</script>
<div id="div1">123</div>
<img alt="" src="../../images/msg.png" onclick="cheshi(2)"/>
case "cheshi": //
cheshi(context);
break;
private void cheshi(HttpContext context)
{
int id = DTRequest.GetFormInt("id");
BLL.word bl=new BLL.word();
Model.Word wo=new Model.Word();
wo = bl.GetGoodsModel(id);
context.Response.Write("{\"word_ename\":" + wo.word_ename + ", \"word_cname\":" + wo.word_cname + "}");
return;
}