js 报错 :object is not a function
object is not a function
我遇到的具体问题是:js命名方法重复了,找到了别的地方,改个方法名就可以了
var h2_price = document.getElementById("h2_price");
var h2_tickets = document.getElementById("h2_tickets");
var h2_accomd = document.getElementById("h2_accomd");
function h2_price(){
bd_price.style.display = "block";
bd_tickets.style.display = "none";
//让军事列表隐藏
bd_accomd.style.display = "none";
//让图片span去掉下边框线
h2_price.style.background = "blue";
//让新闻span加上下边框线
span_news.style.background= "#ccc";
//让军事span加上下边框线
span_js.style.background = "#ccc";
}
上例中的就是h2_price 变量名和函数名重复了,更换一下就可以解决