• <sub id="h4knl"><ol id="h4knl"></ol></sub>
    <sup id="h4knl"></sup>
      <sub id="h4knl"></sub>

      <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
      1. <strong id="h4knl"></strong>

      2. javascript在IE下trim函數無法使用的解決方法

        時間:2024-08-19 10:44:05 JavaScript 我要投稿
        • 相關推薦

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

          首先,javascript的trim函數在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函數無法使用的解決方法】相關文章:

        電腦開機后鼠標無法使用的解決方法01-12

        淺析jQuery 遍歷函數javascript08-06

        IE與Firefox在JavaScript上的不同寫法小結07-22

        Javascript函數的定義和用法分析08-15

        Javascript 閉包引起IE內存泄露分析07-05

        JavaScript中push(),join() 函數實例詳解09-05

        最常用的20個javascript方法函數09-10

        JavaScript日期時間格式化函數08-29

        CAD無法填充解決方法11-25

        使用ajax操作JavaScript對象的方法09-28

        国产高潮无套免费视频_久久九九兔免费精品6_99精品热6080YY久久_国产91久久久久久无码
      3. <sub id="h4knl"><ol id="h4knl"></ol></sub>
        <sup id="h4knl"></sup>
          <sub id="h4knl"></sub>

          <sub id="h4knl"><ol id="h4knl"><em id="h4knl"></em></ol></sub><s id="h4knl"></s>
          1. <strong id="h4knl"></strong>

          2. 天天天天香蕉线视频国产 | 日本少妇爽的嗷嗷叫视频 | 亚洲一级在线免播放观看 | 天天爽天天摸日本一区二区 | 亚洲VA久久久噜噜噜久久 | 亚洲中文成人字幕 |