我试图在我的一个JavaScript程序中对字符串应用.trim()
.它在Mozilla下运行良好,但在IE8中try 时会显示错误.有人知道这是怎么回事吗?有没有我能在IE中实现的方法?
代码:
var ID = document.getElementByID('rep_id').value.trim();
错误显示:
Message: Object doesn't support this property or method Line: 604 Char: 2 Code: 0 URI: http://test.localhost/test.js