1. <tt id="5hhch"><source id="5hhch"></source></tt>
    1. <xmp id="5hhch"></xmp>

  2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

    <rp id="5hhch"></rp>
        <dfn id="5hhch"></dfn>

      1. javascript在IE下trim函數(shù)無法使用的解決方法

        時間:2020-11-15 17:23:36 JavaScript 我要投稿

        有關javascript在IE下trim函數(shù)無法使用的解決方法

          首先,javascript的trim函數(shù)在firefox下面使用沒有問題:

          var test1 = " aa "; test1 = test1.toString(); test1 = test1.trim();

          在火狐下這樣用沒有問題, 但是在IE下就報錯!

          對此,我們可以修改一下:

          String.prototype.trim=function(){return this.replace(/(^s*)|(s*$)/g,"");}

          在頭上加上這一句,上面的就可以在IE和FF下都可以運行了:

          String.prototype.trim=function(){return this.replace(/(^s*)|(s*$)/g,"");} var test1 = " aa "; test1 = test1.toString(); test1 = test1.trim();

          JQuery提供的方法:

          Show Trim Example

          $("button").click(function () { var str = " lots of spaces before and after "; alert(" + str + "); str = jQuery.trim(str); alert(" + str + - no longer"); });

        【有關javascript在IE下trim函數(shù)無法使用的解決方法】相關文章:

        1.移動硬盤不顯示盤符無法使用的解決方法

        2.lookup函數(shù)的使用方法

        3.ie無法打開網(wǎng)頁怎么辦

        4.SATA硬盤無法使用的原因

        5.CAD無法填充解決方法

        6.無法正常使用移動硬盤的原因

        7.關于ie無法打開新窗口的計算機應用知識

        8.小型裝載機在夏季高溫環(huán)境下如何安全使用

        9.SATA硬盤無法用Ghost的原因及解決方法

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码

        1. <tt id="5hhch"><source id="5hhch"></source></tt>
          1. <xmp id="5hhch"></xmp>

        2. <xmp id="5hhch"><rt id="5hhch"></rt></xmp>

          <rp id="5hhch"></rp>
              <dfn id="5hhch"></dfn>