tips == 'show') return true; //tips的cookie不存在
if (tips == "never_show_again") return false;
},
hideTip: function(bNever) {
if (bNever) setcookie('tips', 'never_show_again', 365);
oTips.style.display = "none"; //隐藏
},
showTip: function() {
oTips.style.display = "inline"; //显示,假设tips为行级元素
},
init: function() {
var _this = this;
if (this.check()) {
_this.showTip();
setcookie('tips', 'show', 1);
}
oTips.onclick = function() {
_this.hideTip(true);
};
}
};
page.init();
})();
14.说出以下函数的作用是?空白区域应该填写什么?
//define
(function(window) {
function fn(str)
this.str = str;
}
fn.prototype.format = function() {
var arg = ______;
return this.str.replace(_____, function(a, b) {
return arg[b] 关键词:BAT各大互联网公司javascript前端面试题总结