Я хочу разработать приложение Phonegap и использую jQuery Mobile. Я занимаюсь разработкой и тестированием через Firefox на ПК, поэтому описанные здесь проблемы не имеют ничего общего с Phonegap - это проблема Firefox для ПК:
Следующий код не работает, и мне нужна помощь, чтобы указать мне правильное направление:
var loadWeather = function()
{
// Request absetzen
$.ajax(
{
// the URL for the request
url : 'http://www.google.com/ig/api',
// the data to send (will be converted to a query string)
data : {
weather : 'Vienna'
},
// whether this is a POST or GET request
type : 'GET',
// the type of data we expect back
dataType : 'xml',
// code to run if the request succeeds; the response is passed to the function
success : function(xml)
{
parseXML(xml);
},
// code to run if the request fails;
// the raw request and status codes are passed to the function
error : function(xhr, status)
{
alert('Error retreiving weather!');
}
});
}
статус "ошибка", xhr.readyState = 0, xhr.status = 0, поэтому я не получаю никакой информации по причине из jQuery. Запрос выполнен, ответ-заголовок (от Firebug):
Accept: application/xml, text/xml, */*; q=0.01
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection: keep-alive
Host: www.google.com
Origin: null
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
и 200 ОК. Так почему я прыгаю в случае ошибки? xhr.isRejected () говорит, что верно. Что это значит?