У меня проблемы с возвратом HTML из этого вызова ajax.Он отлично работает в FF, но дает мне "ноль" в IE для alert(result.html());
Вот код.Есть идеи?Спасибо !!!
Переменная ошибок также равна нулю в IE.
Кроме того, не имеет значения, какой элемент я использую в .find()
, поскольку он по-прежнему равен нулю.
function update_price() {
$.ajax({
url: $("form[name='MainForm']").attr('action'),
data: $("form[name='MainForm']").serialize() + '&btnupdateprice.x=0&btnupdateprice.y=0',
type: 'POST',
cache: false,
success: function (response) {
var errors = $(response).find("#listOfErrorsSpan");
var result = $(response).find(".colors_productprice:eq(0)");
alert(result.html());
$(".colors_productprice:eq(0)").replaceWith('<font class="colors_productprice">' + result.html() + '</font>');
$('#listOfErrorsSpan').replaceWith('<span id="listOfErrorsSpan">' + errors.html() + '</span>');
}
});
}
$(function () {
$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").each(function () {
$(this).change(function () {
update_price();
});
});
$("a[href^='javascript:change_option']").each(function () {
$(this).click(function () {
var result_href = $(this).attr('href').match(/\'(.*?)\'/)[1];
var result_val = $(this).attr('href').match(/\,(.*?)\)/)[1];
change_option(result_href, result_val);
update_price();
return false;
});
});
});
Вот HTML-код из вызова Ajax.
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<b><font class="pricecolor colors_productprice"><span class="price_name"><font class="text colors_text"><b>Our Price: </b></font></span>
<span class="price1">$505.00</span>
</font>
</b>
</tr>
</table>
В FF я получаю это для предупреждения.
<span class="price_name"> Price with added options: </span><span class="price1">$505.00</span>