Хорошо, поэтому я могу проанализировать XML с помощью jQuery, но, похоже, он работает только в FireFox, а не в IE.
Мой файл XML:
<?xml version="1.0" encoding="utf-8" ?>
<Answers>
<Question>
<question-title>Question One - Title</question-title>
<a>24</a>
<b>36</b>
<c>10</c>
<d>30</d>
</Question>
</Answers>
Мой код, который анализирует XML:
var xmlType = 'xml';
if ($.browser.msie) {
xmlType = 'text/xml'
}
$.ajax({
type: "GET",
url: "answers.xml",
dataType: xmlType,
success: function(xml) { //if the XML exists
$(xml).find('Answers').each(function(){ //go inside answers
$(this).find('Question').each(function(){ //for each question...
var moo = $(this).find('question-title').text();
$('.question-title').append(moo); //append the question title
var a = $(this).find('a').text();
var b = $(this).find('b').text();
var c = $(this).find('c').text();
var d = $(this).find('d').text();
$('.label1').html(a+'%');
$('.label2').html(b+'%');
$('.label3').html(c+'%');
$('.label4').html(d+'%');
$('.input1').val(a);
$('.input2').val(b);
$('.input3').val(c);
$('.input4').val(d);
$('.cu-mid','.cuboid.'+'green1').animate({
height: a
}, 550);
$('.cu-mid','.cuboid.'+'green2').animate({
height: b
}, 550);
$('.cu-mid','.cuboid.'+'green3').animate({
height: c
}, 550);
$('.cu-mid','.cuboid.'+'green4').animate({
height: d
}, 550, function() {
$('.cu-mid').animate({
height: '+='+50
}, 550);
});
});
});
}
});
Вывод в FireFox является правильным - высота над необходимыми элементами.Но в IE - ничего ... zip ... nada ...
Сначала я подумал, что это может быть dataType
, поэтому я добавил оператор if
... Это непомогите либо.
Есть идеи, умные тела?!
Приветствия.
edit : Я получаю следующие ошибки в IE:Неверная строка аргумента 66 - конечная скобка в: $(xml).find('Answers').each(function(){
Объект ожидаемой строки 1 - ???