Arunkumar K

Arunkumar K

  • NA
  • 5
  • 837

$http.jsonp error : Failed to execute 'removeChild' on 'Node

May 19 2018 5:26 AM
Hi,
I upgrade my angular Js version to 1.6.7 from 1.2.8. I rewrote my jsonp call. I am able to get the jsonp response. But while rendering the details to UI, angularJs throws some exception. Please find the stack trace below. Let me know if you have any thoughts on this.
Code:
function loadContent ( main, sub ) {
// main and sub are url
var myModuleVariable = angular.module("myAPP", [ 'ngSanitize' ]);
myModuleVariable.controller('mainController',[ '$scope', '$http', '$sce' , function mainController ($scope, $http , $sce) {
//debugger;
$http.jsonp($sce.trustAsResourceUrl(main),{jsonpCallbackParam: 'callback'}).
then(function onSuccess(response) {
//$scope.SubData= data;
$scope.appmain = response.data;
$scope.myAPPNotificatation =$scope.appmain[0].notification;
$scope.myTest =$scope.app main[0].description;
} ,function onError(response) {
//$scope.data = "Request failed";
$scope.error ="Something went wrong";
});
}]);
myModuleVariable.controller("subController", [ '$scope', '$http', '$sce' , function subController($scope,$http, $sce)
{
$http.jsonp( $sce.trustAsResourceUrl(sub),{jsonpCallbackParam: 'callback'}).then(function onSuccess(response) {
$scope.SubData= response.data;
}, function onError(response) {
//$scope.data = "Request failed";
$scope.error ="Something went wrong";
});
}]);
}
Exception:
angular-1.6.7.js:12880 Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at HTMLScriptElement.callback (https://localhost:8080/myapp/js/angular-1.6.7.js:12880:24)
callback @ angular-1.6.7.js:12880
error (async)
jsonpReq @ angular-1.6.7.js:12899
(anonymous) @ angular-1.6.7.js:12746
sendReq @ angular-1.6.7.js:12564
serverRequest @ angular-1.6.7.js:12312
processQueue @ angular-1.6.7.js:17145
(anonymous) @ angular-1.6.7.js:17193
$digest @ angular-1.6.7.js:18331
$apply @ angular-1.6.7.js:18628
bootstrapApply @ angular-1.6.7.js:1958
invoke @ angular-1.6.7.js:5097
doBootstrap @ angular-1.6.7.js:1956
bootstrap @ angular-1.6.7.js:1976
angularInit @ angular-1.6.7.js:1861
(anonymous) @ angular-1.6.7.js:34186
l @ jquery-3.3.1.js:2
c @ jquery-3.3.1.js:2
setTimeout (async)
(anonymous) @ jquery-3.3.1.js:2
u @ jquery-3.3.1.js:2
fireWith @ jquery-3.3.1.js:2
fire @ jquery-3.3.1.js:2
u @ jquery-3.3.1.js:2
fireWith @ jquery-3.3.1.js:2
ready @ jquery-3.3.1.js:2
_ @ jquery-3.3.1.js:2
Kindly share your thoughts on this. Thanks.

Answers (1)