これがばかげた質問である場合は申し訳ありませんが、私はどこを見ても答えが見つかりません。
mootools 1.2.5 Request.JSON を使用して、json データを返す ajax リクエストを作成しています。すべてのブラウザーで正常に動作し、有効な json データ ( http://jsonlint.comおよびhttp://jsonformatter.curiousconcept.comで検証済み) を返しますが、iPhone で同じスクリプトを試して応答をログに記録すると、「null」が表示されます。 ' 次のエラー -- TypeError: 'null' はオブジェクトではありません。
どんな提案でも大歓迎です。ありがとう。
limit と limitstart のみを要求するリクエストの簡易バージョンを次に示します。
var jsonRequest = new Request.JSON({
method: 'get',
url: myurl,
data:{
'limit': 10,
'limitstart': 0
},
onSuccess: function( response ) {
if (/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
console.log(response); // returns 'null' on iphone - only one tested so far
}
//otherwise, returns valid json on all web browsers and continues fine
readMap( response );
},
onRequest: function () {
$('loading_div').style.display="block";
},
onComplete: function(){
$('loading_div').style.display="none";
}
}).get();
ブラウザで返される応答のスニペットを次に示しますが、iPhone では「null」のみを返します。
[{"street_address":"My Street Address","id":"2","short_description":"asdf","city":"Seattle","price":"234.00","formattedprice":"$234.00\/week","totalcount":"1"}]