ie8 do not support trim method

Then write yourself a trim () 
String.prototype.trim = function() {
                return this.replace (/ (^ \ s *) | (\ s * $) / g, ""); // regular matches space  
   }

Guess you like

Origin www.cnblogs.com/j190512/p/12574401.html