0

Using this URL:

http://mesto.nu/mesto/index.php?service=Service_Person&operation=getPerson&params={%22user_id%22:%687456%22,%20%22user_token%22:%232323227acb58da8c44c05c3bb12124113a0e2f55302fed84ed941b7f78a95111%22,%20%22person_id%22:%098678%22}"

in the browser produces this JSON:

"HEJSA{"errorCode":0,"data":{"name":"Niklaas Maverick Ingstrup","sex":"Mand","sex_id":"1","marital_status":"Single","marital_status_id":"2","birth_date_stamp":"672357600","image_url":"http:\/\/83.221.133.106\/pictures\/default\/person\/big1.gif","orig_image_url":"http:\/\/83.221.133.106\/pictures\/default\/person\/orig1.gif","per_favourite_place":"Minibar","checkin_venue_name":"null","friend_status":0,"blocked":false,"lat":null,"long":null,"visible":false,"fields":[{"field_id":"12","field_name":"Beskrivelse","values":[{"value_id":"2829","value_text":"20 \u00e5rig \u00f8konomi studerende ved \nKU. "}]}]}}"

How can I trigger this URL in HTML or JavaScript or jQuery? I want to use in PhoneGap for iOS.

4

1 に答える 1

2

ある種の API キーを使用してこの Web アプリケーションによって承認されているか、このサイトの管理者によって承認されていない限り、有効な方法で JSON を取得することは非常に困難です。あなたのドメインは Access Control によって許可されません。

クロスドメイン AJAX の詳細:

http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

それ以外の場合、jquery では次のように簡単です。

var jsonObject = $.getJSON("http://yourlongurl.com");

于 2012-05-09T21:55:20.247 に答える