欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > > 文章正文

.substring error: “is not a function”,.substringfunction

来源: javaer 分享于  点击 7773 次 点评:165

.substring error: “is not a function”,.substringfunction


var currentLocation = document.location,
muzLoc = currentLocation.substring(0,45),

这时候如果执行,总是无法输出muzLoc,因为本来这个语法就出错了,document.location是一个对象,把一个对象当作字符串肯定是出错的

应该先currentLocation.toString()然后再用截取字符串

相关文章

    暂无相关文章

用户点评