要是你这样想当然,那就会冒出你容易忽视的错误,这样firefox可以,chrome不行:
function stat_user(locm,type='link'){
//todo 这是php的写法呀!!!
}
JS应该这样:
function stat_user(loc){
var type=arguments[1]?arguments[1]:'link'; //默认值参数
//todo
}
要是你这样想当然,那就会冒出你容易忽视的错误,这样firefox可以,chrome不行:
function stat_user(locm,type='link'){
//todo 这是php的写法呀!!!
}
JS应该这样:
function stat_user(loc){
var type=arguments[1]?arguments[1]:'link'; //默认值参数
//todo
}