我有這樣的JSON數組:jQueryUI的自動完成不了解JSON?
[
{"name":"Mario Kart Wii"},
{"name":"Super Mario Galaxy 2"},
{"name":"Super Mario Galaxy"},
{"name":"Mario Sports Mix"},
{"name":"Mario & Sonic at the Olympic Winter Games"}
]
差不多簡單。
我的jQuery代碼:
我的問題是 - 當JSON更簡單,如:
[
"Mario Kart Wii",
"Super Mario Galaxy 2",
"Super Mario Galaxy",
"Mario Sports Mix",
"Mario & Sonic at the Olympic Winter Games"
]
它的偉大工程。但如果它更像第一個,它沒有得到任何結果。我需要保持它像第一個一樣,因爲我希望以後每個數組中都有更多的元素。
我不遵循關於「我希望以後每個數組中都有更多元素」的評論。您可以根據需要擁有儘可能多的數組元素,只需根據可接受的格式將其鍵入(或不使用鍵即可)。 –