From 6572748fbb345ca2c038cfdfd8cdf0b660a4e808 Mon Sep 17 00:00:00 2001 From: Anthony Corbacho Date: Wed, 16 Nov 2016 16:52:56 +0900 Subject: [PATCH] ZEPPELIN-1672 - Fix import notebook front end feature --- .../notenameImport.controller.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/zeppelin-web/src/components/noteName-import/notenameImport.controller.js b/zeppelin-web/src/components/noteName-import/notenameImport.controller.js index d2d1b8dcdc..48adaee0fa 100644 --- a/zeppelin-web/src/components/noteName-import/notenameImport.controller.js +++ b/zeppelin-web/src/components/noteName-import/notenameImport.controller.js @@ -83,12 +83,20 @@ vm.importNote = function() { $scope.note.errorText = ''; if ($scope.note.importUrl) { - jQuery.getJSON($scope.note.importUrl, function(result) { - vm.processImportJson(result); - }).fail(function() { - $scope.note.errorText = 'Unable to Fetch URL'; - $scope.$apply(); - }); + jQuery.ajax({ + url: $scope.note.importUrl, + type: 'GET', + dataType: 'json', + jsonp: false, + xhrFields: { + withCredentials: false + }, + error: function(xhr, ajaxOptions, thrownError) { + $scope.note.errorText = 'Unable to Fetch URL'; + $scope.$apply(); + }}).done(function(data) { + vm.processImportJson(data); + }); } else { $scope.note.errorText = 'Enter URL'; $scope.$apply();