nowtdstr.replace(" ", "AA");就是替换不了保存下来,在其它地方调用显示却又显示出一个问号出来。

解决方案 »

  1.   

    你的空格太多了吧?String.prototype.trim = function() {
      return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
    }
      

  2.   

    +1nowtdstr.replace(/^\s*|\s*$/g, "AA");
      

  3.   

    nowtdstr.replace(/\s*/g, "AA");
      

  4.   

    是不是 jquery,$(this).text()将html 代码又转换其它字符了
      

  5.   

    发现 $(this).html()得到内容td单元中内容是   
    是不是这个原因,所以引起空格替换不了
    现在就如何办呢
      

  6.   

    text() 方法的工作方式与 html() 类似,但是会对标签进行转义 。。与这个有关系?