As the title states, I'm trying to call a RESTlet from a 3rd party site. Since this is new for me, I'm trying to keep it simple to start. I'm following the NetSuite documentation (including the JavaScript code here), but I can't get it to work. Currently, I'm getting a permissions error:[CODE]XMLHttpRequest cannot load https://xxxxxxxxxxx. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxxxxx' is therefore not allowed access. The response had HTTP status code 401.[/CODE]So what am I doing wrong? Here's the HTML for the scripts on my page: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js"></script> <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script> <script src="oauth-1.0a.js"></script> <script src="restlet-test.js"></script>
And here's the code for my JS file:[CODE]$(function(){ var oauth = OAuth({ consumer: { public: 'xxxxxxxxxxxxxxxxx', secret: 'xxxxxxxxxxxxxxxxx' }, signature_method: 'HMAC-SHA1' }); var request_data = { url: 'xxxxxxxxxxxxxxxxxxxxxxx', method: 'GET' }; var token = { public: 'xxxxxxxxxxxxxxxxxxxxxxxxxx', secret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' }; var authHeaders = oauth.toHeader(oauth.authorize(request_data, token)); $.ajax({ url: request_data.url, type: request_data.method, headers: authHeaders }).done(function(data) { console.log(data); });});[/CODE]Please, take a look at my code and tell me what I've missed. This is all new to me and it is quite frustrating to troubleshoot when you don't really know what you're doing.