Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:14:41+00:00 2026-05-28T13:14:41+00:00

I have a JSON format result sent back to the client that hold the

  • 0

I have a JSON format result sent back to the client that hold the $quot sign. for some unknown reason the code breaks.

Here is the code that bricks from ext-all-debug:

doDecode = function(json){
   return eval("(" + json + ")");    FAILS HERE
},

Here is my JSON as it left the server (As far as I know , I hope the server doesn’t take the time to decode this &quot on its free time.):

{
success: true,
total: 1,
results: [{
    "ID": -1,
    "Value": "POChangeRequestlblCustomerCatalogNumber",
    "Description": "",
    "Labels": {
        "1": {
            "ID": -1,
            "LanguageID": 1,
            "Value": "Catalog Number",
            "ToolTip": "",
            "LanguageName": "English",
            "KeyID": -1,
            "KeyValue": "POChangeRequestlblCustomerCatalogNumber",
            "KeyDescription": ""
        },
        "2": {
            "ID": -1,
            "LanguageID": 2,
            "Value": "&quot;", <<< THIS IS THE BAD PART!!!
            "ToolTip": "",
            "LanguageName": "Hebrew",
            "KeyID": -1,
            "KeyValue": "POChangeRequestlblCustomerCatalogNumber",
            "KeyDescription": ""
        }
    },
    "ServerComments": "1"
}]
}

this JSON is sent in a text/html content type as it is the result of a file upload operation. could that be part of the problem?

Ok, I have continued to trace down the problem and found that ExtJS does this function on the returned value from a hidden iframe:

doFormUpload : function(o, ps, url){
        ...

            try{
                doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
                if(doc){
                    if(doc.body){
                        if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ 
                            r.responseText = firstChild.value;
                        }else{
                            r.responseText = doc.body.innerHTML;  << THIS IS WHERE MY &quot; get decoded back to " (sign)
                        }
                    }

                    r.responseXML = doc.XMLDocument || doc;
                }
            }
            catch(e) {}

            ...
    }

Is there a good workaround for this issue. it seems that the browser automatically decodes the value???? any one???? this is a major issue !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:14:42+00:00Added an answer on May 28, 2026 at 1:14 pm

    Here is how I worked around it.

    The problem was that all browsers automatically decode the & quot; signs.

    So I have fixed the Ext doFormUpload function to look like this:

      doFormUpload : function(o, ps, url){
        ...
    
            try{
                doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
                if(doc){
                    if(doc.body){
                        if(doc.body.innerText){
                                r.responseText = doc.body.innerText;
                            }else{
                                r.responseText = doc.body.innerHTML.replace(/<pre>/ig,'').replace(/<\/pre>/ig,'');
                            }
                    }
    
                    r.responseXML = doc.XMLDocument || doc;
                }
            }
            catch(e) {}
    
            ...
    }
    

    In addition from now on the content type that the server is returning is “text/plain”
    this prevents the browsers from decoding the data.
    I also added a little workaround from FF that does not support innerText property but adds the tag that wraps the response.

    This is an ugly hack to the ExJS framwork but it worked for me.

    Hopefully someone will notice the question and have some better idea on how to solve it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one JSON that is coming in a string format. I need to
I have a JSON result that contains numerous records. I'd like to show the
i have following json format { status: ACTIVE, result: false, isworking: false, margin: 1,
I have a JSON format like this {response:{status:true,result:user_exists}} Now i am trying to retrieve
I have a JSON result in the following format which JSON Lint shows this
I have an application which obtains data in JSON format from one of our
I have a configuration file in the following JSON format: { key1: value1, key2:
I have a restful web service which can deal with DTOs in json format
I have an external file in php, outputed as json format I want the
I have some JSON returned to the browser like this product: { Title: School

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.