在ie 7 8浏覽器中使用如下代碼會報錯
經查閱資料發現時相容性問題,解決方案如下,在js中添加如下代碼
String.prototype.trim = function () {
return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' );
}
這樣就可以解決問題。
參考文檔
http://www.jb51.net/article/50356.htm
http://blog.csdn.net/error_case/article/details/8280781