You need to sign in to do that
Don't have an account?
VDave
AJAX Request IE Status 0
I am having trouble getting my Visualforce page to make an AJAX request in IE 10, 11. Everything works fine in Chrome, and Firefox but in IE 10, 11 I get status 0 when I make a request. I can't figure out what I am missing. Is there a bug/limitation somewhere that I am unaware of?
Here is the code (http://jsfiddle.net/LmfsY/2/) on jsfiddle showing it works outside of Visualforce.
Here is a Visualforce page that demonstrates the issue.
In IE the provided visual force page results in {"readyState":0,"status":0,"statusText":"Access is denied.\r\n"}
In Chrome/Firefox the provided visual force page results in {"status":"ok"}
Here is the code (http://jsfiddle.net/LmfsY/2/) on jsfiddle showing it works outside of Visualforce.
Here is a Visualforce page that demonstrates the issue.
<apex:page> <div class="document"> <a class="ajax" href="#">Fire an AJAX request</a> </div> <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script> $.support.cors = true; $(function() { $('.document').on('click', '.ajax', function(e) { e.preventDefault(); // ajax request $.ajax({ type: 'get', url: 'https://cors-test.appspot.com/test', dataType: 'html', beforeSend: function() { console.log('Fired prior to the request'); }, success: function(data) { console.log('Fired when the request is successful'); $('.document').append(data); }, error: function (xhr) { console.log('Fired when the request is NOT successful'); $('.document').append(JSON.stringify(xhr)); }, complete: function(xhr) { console.log('Fired when the request is complete'); } }); }); }); </script> </apex:page>
In IE the provided visual force page results in {"readyState":0,"status":0,"statusText":"Access is denied.\r\n"}
In Chrome/Firefox the provided visual force page results in {"status":"ok"}
You need to enable 'Access data sources across domain'
1) Select Internet Options
2) Select the Security Tab
3) Select Custom level...
4) Scroll down to Miscellaneous
5) Find Access data sources across domains
6) Change the value to Enable
All Answers
You need to enable 'Access data sources across domain'
1) Select Internet Options
2) Select the Security Tab
3) Select Custom level...
4) Scroll down to Miscellaneous
5) Find Access data sources across domains
6) Change the value to Enable