문제

I am trying to send some Angular object through JSON.

I tried this.

$scope.dkPrintData=function(){
$scope.myData={name:'Ramesh',class:'XII',Marks:'90%'};
$http.get('dkStudnet.do?method=JsonData&Student='+ angular.toJson($scope.myData))
.success(function(data, status, headers, config) {

 });

If I removed % symbol in the $scope.MyData object it is working fine but it is not accepting special charters like %.

도움이 되었습니까?

해결책

'dkStudnet.do?method=JsonData&Student='+ encodeURIComponent(angular.toJson($scope.myData))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top