2

My Object label is D & B Company, this is stored in a list at some place

When it comes to visualforce page in angular code, it is showing D&B Company

How can handle such type of special character in angular, I tried escape ="false" but no result

function(result, event) {
                    $scope.Data =  result;
                    $scope.$apply();

                    angular.forEach($scope.Data, function(value, key){
                        if(value.objApiName == 'DatacloudDandBCompany')
                        {
                            var t = value.objLabel;

                        console.log("username is ::" + decodeURIComponent(t)); 
                        }
                    });

2 Answers 2

1

Use this for decode your url

your_url = decodeURIComponent(your_url);
your_url  = decodeURI(your_url );

Use this for encode url

your_url = encodeURIComponent(your_url);
your_url  = encodeURI(your_url );

It may be helpful for you.

0

You are probably not escaping the output of your RemoteAction method - several html chars are encoded as HTML entities when they are sent this way - but you can turn this off like so:

Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.YourClass.yourMethod}',
    someParam, 
    function(result, event){
        //... your stuff
    }, 
    {escape: true}
);

(it's the last parameter of the call - {escape : true} that you want)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .