我想通过“passedThisValue”我的“start_battle”功能,并在我的“复赛”中使用“start_battle”功能。但模态只是挂起为什么会发生这种情况?有什么可能是错的?请帮忙! :) 谢谢。我怎么能通过这个特定的变量我正在使用jquery-ajax
CODE:
function start_battle(){
$.ajax({
data: {
receivePassedValue: passedThisValue
},
success: function(data){
}
});
}
$("#start_battle").click(function() {
$.ajax({
success: function(data){
var toAppend = '';
if(typeof data === "object"){
var passedThisValue = '';
for(var i=0;i<data.length;i++){
passedThisValue = data[i]['thisValue'];
}
start_battle(); // can I still get the passedThisValue?
}
}
});
$("#battle").dialog({
modal:true,
buttons: {
"Rematch": function(){
start_battle(); // can I still get the passedThisValue?
}
}
});
$("#battle").show(500);
});
对不起,我只是错误类型调用函数^^,start_battle(passedThisValue)?我使用的是萤火虫,它继续到start_battle() –