ext 中 missing } in XML expression 的解决办法

    missing } in XML expression

说有返回值都会添加 <pre>

   (<pre>{success:true, msg:'成功'}</pre>) ... ext-all.js (line 7364)最后查了官方论坛,发现有些人也遇到和我一样的问题,但是网络上基本上没有解决方案,只是最终发现是由于fileUpload属性的特殊机制导 致,当fileUpload为true时,formpanel在提交后返回的json数据都会被bug上一个<pre>标签,这个在 ff1.5里正常, 2.0以上都会有此BUG, IE6下正常。为解决此BUG,在ext-all.js里修改如下:{code}


        //解决ff里的bug
        var temp;
        if(json.indexOf('<pre>') != -1){
            temp = json.substring(5, json.length-6);
            alert("temp = " + temp)
            return eval("(" + temp + ')');
        }

{code}

还有一种办法是 

 后台这样处理

    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType 
= "text/html";
        context.Response.Write(
@"{success: true, data:'1'}");
    }
原文地址:https://www.cnblogs.com/gwazy/p/1516542.html