zoukankan      html  css  js  c++  java
  • 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'}");
        }
  • 相关阅读:
    输入汉字转拼音
    DBGridEh(RestoreGridLayoutIni)用法
    当选中节点的同时选中父节点
    implsments
    HTML中的post和get
    SmartUpload中文乱码
    调查平台,考试系统类型的数据收集型项目
    final
    职业生涯中12个最致命的想法
    abstract
  • 原文地址:https://www.cnblogs.com/gwazy/p/1516542.html
Copyright © 2011-2022 走看看