【发布时间】:2013-08-22 19:22:09
【问题描述】:
我有页面跟踪/跟踪像素页面,该页面当前正在使用 $.post(PAIRS-DATA) 将 JavaScript 中收集的信息发布回服务器。然后最终加载为跟踪像素。
finally
{
//tracking pixel
Response.ContentType = "image/gif";
byte[] buffer = pix.BinaryData;
int len = buffer.Length;
Response.OutputStream.Write(buffer, 0, len);
}
问题是,$.post(PAIRS-DATA) 在 Chrome 中被取消了,因为它是跨域的。所以我尝试了
$.ajax({
type: "POST",
dataType: "jsonp",
jsonp: false,
processData: false,
crossDomain: true,
url: "URL",
data: dataPairs
});
这解决了跨域问题,但我现在得到“资源解释为脚本但使用 MIME 类型图像/gif 传输:”
我该如何解决这个问题? $.ajax 调用有问题吗?
【问题讨论】:
标签: javascript asp.net ajax json tracking