我正在使用jQuery构建用户配置文件页面,从json类型数据库中提取。我在使用ajax填充页面时相当缺乏经验,所以现在,页面加载需要太长时间。如果我可以帮助改进我的代码,优化和加快页面加载,我真的很感激。
目标:我正在尝试从为多个拥有多个数据点的用户构建的JSON数据库中获取信息。以下是JSON数据的示例。我希望在选择了标签后显示信息。
每个配置文件中都有大量数据,特别是出版物。用户可以拥有任意数量的pub,我的代码现在遍历所有数据,然后再将其写入页面。


{
"Error": false,
"Cached": false,
"Profile": {
"FirstName": "John",
"LastName": "Smith",
"PreferredName": "",
"Email": "[email protected]",
"Gender": "",
"PhoneNumber": "1234567890",
"Office": "Todd Hall Addition 570B",
"EndowedPosition": "MAJOR POSITION #1",
"Biography": "THIS IS A BIOGRAPHY",
"Appointments": [
{
"Title": "Title 1",
"WorkingTitle": "",
"Rank": "",
"Department": "Department1",
"Start": "2014-01-01",
"End": ""
},
{
"Title": "",
"WorkingTitle": "",
"Rank": "Rank 1",
"Department": "Department2",
"Start": "2014-01-01",
"End": ""
},
{
"Title": "Title 2",
"WorkingTitle": "",
"Rank": "",
"Department": "",
"Start": "2014-01-01",
"End": ""
}
],
"IntellectualContributions": [
{
"Type": "Book",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "TitleMain",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "TitleMain",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Manuscript",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "TITLEMAIN",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Book Review",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "Title",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": ["Author1"]
},
{
"Type": "Newspaper",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "Title",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": [
"Author 1",
"Author 2",
"Author 3",
"Author 4"
]
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "Title",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "TITLE",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Published",
"Title": "TITLE",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": ["Author 1"]
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Submitted",
"Title": "Title",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
},
{
"Type": "Journal Article",
"TypeOther": "",
"IncludeProfile": "Yes",
"Status": "Working Paper",
"Title": "TITLE",
"TitleSecondary": "",
"FirstName": null,
"MiddleName": null,
"LastName": null,
"Role": null,
"JournalName": "",
"Publisher": "",
"Volume": "",
"IssueNum": "",
"PageNum": "",
"WebAddress": "",
"CaseNum": "",
"YearPub": "",
"Authors": []
}
],
"Education": [
{
"DegreeType": "PhD",
"DegreeOther": "",
"School": "University",
"Major": "MAJOR 1",
"FocusArea": "Focus Area",
"DissertationTitle": "Dissertation Title",
"Highest": "Yes"
},
{
"DegreeType": "MBA",
"DegreeOther": "",
"School": "University",
"Major": "MAJOR 1",
"FocusArea": "",
"DissertationTitle": "",
"Highest": ""
},
{
"DegreeType": "BBA",
"DegreeOther": "",
"School": "University",
"Major": "MAJOR 1",
"FocusArea": "",
"DissertationTitle": "",
"Highest": ""
}
],
"Present": [
{
"Title": "Presentation Title",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3",
"Author4"
],
"Date": "2014"
},
{
"Title": "Presentation Title",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3"
],
"Date": "2014"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3",
"Author4",
"Author5"
],
"Date": "2013"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3",
"Author4",
"Author5"
],
"Date": "2013"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Paper",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3",
"Author4",
"Author5"
],
"Date": "2012"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3",
"Author4",
"Author5"
],
"Date": "2012"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3"
],
"Date": "2012"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2"
],
"Date": "2012"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
],
"Date": "2012"
},
{
"Title": "PRESENTATION TITLE",
"Type": "Oral Presentation",
"Name": "NAME",
"Authors": [
"Author1",
"Author2",
"Author3"
],
"Date": "2012"
}
],
"Departments": [
"Department1",
"Department2"
],
"Research": [
"Research1",
"Research2",
"Research3",
"Research4",
"Research5"
],
"Teaching": [
"Teaching1",
"Teaching2",
"Teaching3",
"Teaching4"
]
}
}


非常感谢任何和所有帮助!