Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Cross-Domain support in JScript?

$
0
0

Hello, I've been trying for a few days to find a solution to enabling cross-domain calls in JScript. I've found solutions to get cross-domain XMLHTTPRequests to by disabling web security (for IE and Chrome), but I am trying to find a solution to avoiding having users turn these settings and securities off to allow cross-domain calls work.

I've tried adding headers to these XMLHTTPRequests, but no luck. I also tried just sending the generated URL to my local drive, but I get Access is denied. Here is my code:

function SendRequest(oDataURI) {

    var req = new XMLHttpRequest();
    req.open("GET", encodeURI(oDataURI), false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.send();
    
    if (req.readyState == 4 && req.status == 200) {
        req.onreadystatechange = null; //avoids memory leaks
        return req;
    }
}

This function works fine if I change security settings, but once I enable the security then the scripts refuses to send. At this point, I'm open to other suggestions or sample scripts that show a working solution to a cross-domain call.

Thanks in advance.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>