Have you tried adding clientaccesspolicy.xml file to the root with the following in it?
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
I am also using a div to display any error messages in, for debugging purposes, as that might help you to see what error message in in the JSON String:
function GetShoppingCartData() {
jQuery.ajax({
type: "POST",
url: "DesktopModules/EcomDnnProducts/AjaxProductDisplay.aspx/GetShoppingCartData",
data: "{'CartId': '" + jQuery(".shoppingcartid").attr("value") + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg) {
buildShoppingCart(msg.d);
},
fail: function (msg) {
jQuery('#productattributesdata').text(msg.d);
}
});
}
In my .net code, I had to add the following to the web.config file:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
<system.web>
hth