append中和普通html页面中onclick使用方法还是有很大区别的
js中append拼接字段需要非常细心,结果如下:
for (j = 1; j <= result.data.AllPage; j++) {
$("#bsdoctorPage").append("<a onclick='doctorPage(\""+j+"\")'>"+j+"</a>");
}
function doctorPage(PageIndex){
alert(PageIndex);
}