我的js文件如下;
$('#DetailMaxGuest').change(function () {
var result = $('#DetailMaxGuest option:selected').val();
$('#DetailMaxGuest option:selected').val(result).attr('selected', 'selected');
var resultparse = parseInt(result);
var resultid = $('#resultid').val();
var dateBegin = $('#DetailDatepicker').val();
var dateEnd = $('#DetailDatepickerEnd').val();
var price = $('#DetailRates option:first').val();
var resultm = $('#DetailMaxGuest option:selected').val();
if (resultm != "Select One") {
kisi = parseInt(resultm);
} else {
kisi = null;
}
var message = {
'resultid': resultid,
'data': resultparse,
'dateBegin': dateBegin,
'dateEnd': dateEnd,
'price': price
};
$("#LoadingImage").show();
$.ajax({
type: 'GET',
url: '/Product/GetMaxGuest',
data: message,
dataType: 'json',
success: function (data) {
if (data.error) {
$("#LoadingImage").hide();
$('#reservation-result').html(data.msg).fadeIn(2000);
$('#btn_reservation').hide();
$('#btn_liste').show();
} if (data.success) {
$("#LoadingImage").hide();
if (kisi != null) {
$('#PriceDetails').show();
} else {
$('#PriceDetails').hide();
}
$('#lblTotalPrice').html(data.toplam).fadeIn(2000);
$('#lblDeposit').html(data.deposit).fadeIn(2000);
$('#lblTotal').html(data.totalsum).fadeIn(2000);
$('#btn_reservation').show();
$('#btn_liste').hide();
}
},
complete: function () {
$('#reservation-result').fadeOut(5000);
}
});
});
和我的控制器返回消息;
存款:“100 美元”味精:“”成功:真 toplam:“1.220 美元”总计:“1.320 美元”
但我在我的页面上看不到任何数据。js 工作,但我看不到数据。
我的剃须刀;
<div id="reservation-result" style="width: 100%; height: 80px; display: inline-block; text-align: left; font-size:12px; font-weight: bold; color:brown;">
<table id="PriceDetails" style="display: none;">
<tr>
<td style="width: 75%;">Toplam Fiyat</td>
<td style="width: 25%; text-align: right;"><div id="TotalPrice">@Html.Label("lblTotalPrice",new{id="lblTotalPrice", name="TotalPrice"})</div></td>
</tr>
<tr>
<td>Depozito</td>
<td style="width: 25%; text-align: right;">
<div id="Deposit">@Html.Label("Deposit",new{id="lblDeposit", name="Deposit"})</div>
</td>
</tr>
<tr>
<td>Genel Toplam</td>
<td style="width: 25%; text-align: right;">
<div id="Total">@Html.Label("Total",new{id="lblTotal", name="GrandTotal"})</div>
</td>
</tr>
</table>
<div id="LoadingImage" style="display: none;">
<img src="@Url.Content("~/Content/images/prettyPhoto/dark_rounded/loader.gif")" alt="Loading"/>
</div>
</div>
<input id="btn_reservation" class="gradient-button center" type="submit" style="width: 230px;" value="Rezervasyon yap" />
}
<input id="btn_liste" class="gradient-button center" type="submit" style="width: 230px; display: none;" value="Listeye Dön" />
请helpppp :) 非常感谢。