Pergunta

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 %.

Foi útil?

Solução

'dkStudnet.do?method=JsonData&Student='+ encodeURIComponent(angular.toJson($scope.myData))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top