1
动态调用select事件
我已经使用jQuery API创建标签,并通过使用下面的代码绑定在第二个选项卡中单击一个事件处理程序:无法在标签在jQuery的
$('#tabs').bind('tabsselect', function(event, ui) {
refreshRemoveUI(event,ui);
});
function refreshRemoveUI(event,ui) {
if(ui.index==1){
$.get('FrontServlet?operation=getAllQues',function(data) {
var html = "";
var questionsNum = data.split(",");
if(questionsNum!="") {
html += '<br/><input type=checkbox name=removeAllQuestionId id=removeAllQuestionId onclick="toggleAll(this.checked)"/> Select/Deselect All<br/>';
for(var i=0;i<questionsNum.length;i++){
html += '<br/><input type=checkbox name=removeQuestionId id=removeQuestionId /> ' + questionsNum[i];
}
$('#remove').show();
} else {
$('#remove').hide();
html = 'No question available in quiz';
}
$('#removequestions').html(html);
});
}
}
我想要调用关于Ajax请求的完成也并按照相同的绑定事件是什么,我都试过,但没有运气:
$.get('FrontServlet?operation=remove&position='+val, function(data) {
$("#tabs li.ui-state-default:nth(1)").trigger("select");
});
任何想法的家伙?
只是在这里做一些猜测,因为我不完全知道这件事,没有一个工作样本,它是一个重现问题的大量工作,但不应该''..]。trigger('tabselect ')'而不是'[..]。trigger('select')'? – Jasper