110,533
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
$(document).ready(function () {
$("#button").click(function () {
$.ajax({
type: "post",
dataType: "text",
url: "http://localhost:13440/ashx/imageManager.ashx?nocopyright=1&path=/upload/productdetayue/&",
data: "action=get",
async: true,
success: function (data) {
alert(data);
},
error: function (res) {
alert(res);
}
})
});
});
</script>
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("abc");
}
跨域请求,可以采用jsonp。。
javascript是我写的一个独立页面,专门用于测试的,只有一个button和那个脚本,没有其他的东西。data是字符串类型,就是context.Response.Write("abc");输出的abc一个字符串。本来里面还有别的代码的,但是我看到没有返回值,然后我把代码全部删除了,就留下了这一点点,但是仍然没有返回值。。。。。
你可以在浏览器 调试 你请求到的结果 是什么
不要反复贴源代码,贴出实际的断点调试结果来!
你在 ashx 中设置断点调试了吗?你在javasript代码中设置断点调试了吗?data是什么值?typeof data是什么值?
这怎么会呢?