3
我想获得跨域AJAX后使用easyXdm库工作。使用easyXdm跨域AJAX后
在我的本地开发环境,我有两个网站:
1. http://localhost/MySite/ws/easyXDM/cors/index.html (EasyXdm file) 2. http://localhost/MyClientSite/TestPage.html (AJAX post from here)
TestPage.html(AJAX邮报)
var rpc = new easyXDM.Rpc({
remote: "http://localhost/MySite/ws/easyXDM/cors/index.html"
},
{
remote: {
request: {}
}
});
rpc.request({
url: "http://localhost/MySite/ws/MyService.asmx/DoSomething",
method: "POST",
data: jsonData
}, function(response) {
console.log(JSON.parse(response.data));
$('#thanksDiv').fadeIn(2000, function() {
$('#thanksDiv').fadeOut(4000);
});
});
当我做AJAX后我得到了我的浏览器下控制台:
easyXDM present on 'http://localhost/MySite/ws/easyXDM/cors/index.html?xdm_e=http%3A%2F%2Flocalhost%2FMyClientSite%2FTestPage.html&xdm_c=default884&xdm_p=4
native JSON found
easyXDM.Rpc: constructor
{Private}: preparing transport stack
{Private}: using parameters from query
easyXDM.stack.SameOriginTransport: constructor
easyXDM.stack.QueueBehavior: constructor
easyXDM.stack.RpcBehavior: init
{Private}: firing dom_onReady
... deferred messages ...
easyXDM.Rpc: constructor
{Private}: preparing transport stack
{Private}: using parameters from query
easyXDM.stack.SameOriginTransport: constructor
easyXDM.stack.QueueBehavior: constructor
easyXDM.stack.RpcBehavior: init
... end of deferred messages ...
easyXDM.stack.SameOriginTransport: init
easyXDM.stack.RpcBehavior: received request to execute method request using callback id 1
easyXDM.stack.RpcBehavior: requested to execute procedure request
easyXDM.stack.QueueBehavior: removing myself from the stack
问题: Web服务从未实际接收数据。这很明显,因为我的AJAX发布成功函数应该显示一个thanksDiv
并且还应该在*数据库中创建一条记录。
注:我正在更换现有的AJAX邮编,因为我需要使用easyXdm来解决客户端网站上Internet Explorer 6和7的问题。
附加信息: 的文件结构,其中我easyXdm文件位于如下:
/ws/easyXDM/easyXDM.debug.js
/ws/easyXDM/easyXdm.swf
/ws/easyXDM/json2.js
/ws/easyXDM/name.html
/ws/easyXDM/cors/index.html
存在已经与easyXDM工作这么几个人。你可以看看http://stackoverflow.com/questions/27203172/easyxdm-download-files-from-3rd-party-service吗? – 2014-11-29 22:35:48
@V_B客户端和服务器都必须使用EasyXDM才能成功运行。 – Seany84 2014-11-30 13:57:53