jquery去掉数组最后一个元素_jquery只显示数组的最后一个元素

岳嘉悦
2023-12-01

var businessListings = {

musEnt: {

"Mark's Studios": {

Address: "2407 Linden Street Chester, Pa 19013",

PhoneNumber: "267-808-4256",

Website: "www.markstudios.com",

Specialty: "R&B, Hip Hop"

}, // line ends Mark's Studios info

"CC Moore Recording Studio": {

Address: "1420 Melrose Avenue Chester, Pa 19013",

PhoneNumber: "267-615-2009",

Website: "www.ccmoorestudio.com",

Specialty: "All Genres"

} // line ends CC Moore Recording info

},// line ends musEnt category

paint: {

"Ulysses's Paint": {

Address: "2201 Edgmont Avenue Chester Pa 19013",

PhoneNumber: "267-298-0845",

Website: "www.ulyssespaint.com",

Specialty: "Mixing Paint, Selling All Paint Types"

}, // line ends Ulysses's Paint info

"Dock Paint Supplies": {

Address: "1007 W. 7th Street Chester, Pa 19013",

PhoneNumber: "484-318-5190",

Website: "N/A",

Specialty: "All Paint Type Supplies"

} // line ends Mark's Studios info

}, // line ends paint category info

}; // line ends "multi-dimensional" array object

var selectedCategory;

var textNameOfBusinessCategorySelected;

var nameOfBusinessesUnderCategory;

function businessListingResults(databaseList) {

selectedCategory = $("#select-business-listing option:selected").val();

textNameOfBusinessCategorySelected = $("#select-business-listing option:selected").text();

nameOfBusinessesUnderCategory = databaseList[selectedCategory];

for (findBusinessNamesUnderCategory in nameOfBusinessesUnderCategory) {

$("#listingResults").html("

" + findBusinessNamesUnderCategory + "");

console.log(findBusinessNamesUnderCategory);

} // line ends for in loop

} // line closes function

Select a Category from the drop down menu to check your local businesses

Music and Entertainment

Paint

Search Listings

 类似资料: