.substring error: “is not a function”,.substringfunction
分享于 点击 7773 次 点评:165
.substring error: “is not a function”,.substringfunction
var currentLocation = document.location,
muzLoc = currentLocation.substring(0,45),
这时候如果执行,总是无法输出muzLoc,因为本来这个语法就出错了,document.location是一个对象,把一个对象当作字符串肯定是出错的
应该先currentLocation
.toString()然后再用截取字符串
相关文章
- 暂无相关文章
用户点评