Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var call = $.ajax({
- url: 'http://url:port/DynamicsNAV70_Instance/odata/MyService',
- type: "GET",
- crossDomain: true,
- username: "username",
- password: "password",
- dataType: "jsonp",
- headers: {
- Accept: "application/json;odata=verbose"
- }
- });
- call.done(function (data, textStatus, jqXHR) {
- console.log(data.d);
- });
- call.fail(function (jqXHR, textStatus, errorThrown) {
- console.log("Call failed. Error: " + jqXHR.statusText);
- });
- jQuery.support.cors = true;
- var call = $.ajax({
- url: 'http://url:port/DynamicsNAV70_Instance/odata/MyService?$format=json',
- type: "GET",
- username: "username",
- password: "password",
- dataType: "json",
- headers: {
- Accept: "application/json;odata=verbose"
- }
- });
- $.ajax({
- url: 'http://Server:Port/DynamicsNAV80/OData/Service?$format=json&$callback=?',
- contentType: 'application/json; charset=utf-8',
- dataType: "jsonp",
- type: "GET",
- xhrFields: {
- withCredentials: true
- },
- dataType: "jsonp",
- success: function (data) {
- alert(JSON.stringify(data));
- },
- error: function (xhr, textStatus, errorMessage) {
- alert('Error: ' + errorMessage);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement