ajax返回值自动添加pre标签的解决方法

直接上代码:

 //response = response.replace(/<pre>/ig, "").replace(/<\/pre>/ig, ""); //过滤
                if (response.indexOf("{") > -1 && response.indexOf("}") > -1) {
                    var beginx = response.indexOf("{");
                    var endx = response.lastIndexOf("}") + 1;
                    response = response.substring(beginx, endx);
                }

  

posted @ 2023-05-29 10:58  liskov_design  阅读(26)  评论(0编辑  收藏  举报