我使用的URL我的代碼是:如何從給定的代碼中獲取JSON對象?
var url="http://nucleus/api/projectlist?format=json"
var json=JSON.parse(this.responseText);
在瀏覽器中的JSON格式的數據就像如下
{
"1": {
"id": "91",
"title": "Nucleus Aura",
"project_locations": "TVm, Kochi",
"project_type": "Villa",
"project_status": "Book Now",
"count_plan": 0,
"image": "uploads/project_images/projects_images_image1415954647.png",
"imagetitle": "Villa Night"
}
}
我要打印的JSON數據對象的警告框。
澄清你的問題,請... – n00dl3 2015-03-19 09:59:36
確認一下...你是做實際的AJAX調用(即使你沒有發佈該代碼)是否正確?如果沒有,您需要通過AJAX調用才能正常工作。 – scunliffe 2015-03-19 10:20:16
使用'{}'格式化代碼! – Vikrant 2015-03-19 10:25:05