我想從指定的URL返回JSON數據,但當彈出警報時它只顯示[對象對象](我意識到對象對象實際上不是錯誤)。 我想吐出警報中的位置名稱和其他字段。我該怎麼做呢?JSON返回[對象對象]
這是我在看(完整的文件大約有30貼子)
[
{
"m_id": 473644,
"m_positionName": "Application Monitoring Software Engineer",
"m_positionLocations": [
{}
],
"m_active": true,
"m_description": "Job Responsibilities:\r\n\r\n-Create world class application monitoring tools and dashboards for our health care applications\r\n\r\n-Develop business rules to pro actively identify and re-mediate system-level issues before they occur.\r\n\r\n-Create business intelligence reports for internal and external use as a supplement to software products.\r\n\r\n\r\n\r\nJob Requirements:\r\n\r\n-BS or MS Degree in computer science or any engineering discipline.\r\n-4+ years of experience with Java (or other object-oriented programming language).\r\n-Experience in SQL, Struts, Hibernate, Spring, Eclipse, JSP, JavaScript.\r\n-Highly motivated and self-driven personality.\r\n-Excellent interpersonal and leadership skills.\r\n-A vision for the future and a desire to make a difference.\r\n-Experience with Maven, Tomcat, PostgreSql, Jasper Reports,",
"m_postedDate": "Jun 29, 2012 9:17:19 AM",
"m_closingDate": "Jun 29, 2013 12:00:00 AM"
}
]
的JSON的例子,這裏是我使用的腳本。
$.ajax({
type: "GET",
url: '/wp-content/themes/twentyeleven/js/jobopenings.json',
async: false,
beforeSend: function(x) {
if(x && x.overrideMimeType) {
x.overrideMimeType("application/j-son;charset=UTF-8");
}
},
dataType: "json",
success: function(data){
alert(data);
}
});
任何幫助,非常感謝。
使用'console.log'而不是'alert'。 – undefined