我有如下要求。我的表格有
tab1,tab2,tab3,tab4和tab5(确认标签)。 tab4具有“同意并提交”按钮。 当事务成功时,单击提交按钮(http帖子,而不是ajax)后,应该出现tab5。基于控制器事务成功/失败,如何在下面的javascript中调用?请帮忙。
下面是html标签
func fetchWeather(){
let weatherGetter = GetWeather()
self.cityWeather = [Temperature]()
var networkCallsDone = 0
for city in cities {
weatherGetter.getWeather(city: city) { (temp) in
networkCallsDone += 1
guard let temp = temp else {
if networkCallsDone == cities.count {
DispatchQueue.main.async {
collectionView.reloadData() //In case the last network call to finish does not return valid data
}
}
return
}
print(temp)
self.cityWeather?.append(temp)
if networkCallsDone == cities.count {
DispatchQueue.main.async {
collectionView.reloadData()
}
}
}
}
}
count
谢谢, 苏里亚。
答案 0 :(得分:0)
将Issucess属性添加到模型中,如果交易良好则提交后使IsSuccess = true;然后在jQuery中访问IsSucess,如下所示
$(document).ready(function () {
var onsuccess = "@Model.IsSuccess";
// alert(onsuccess);
if (onsuccess == "True") {
$("ul.nav li").removeClass('active');
$("ul.nav li").removeClass('invisible').addClass('disabledTab');
$('#Confirmation').find('a').trigger('click');
}
});