var clickCount = 0;
function deal() {
if (clickCount < 2 ) {
clickCount++;
//append data
} else if (clickCount == 2){
//link other page
}
}
你用一个变量记一下点击的次数就OK了
既然用的是jquery,可以用toggle方法:
$("#bar").toggle(
function () {//点击第一次
$.get("__URL__/Index/jajax",function(d){
$("ul.news-list").after(d);
});
},
function () {//点击第二次
$.get("__URL__/Index/jajax",function(d){
$("ul.news-list").after(d);
});
},
function () {//点击第三次
location.href="其他页面.html";
}
);