我有一個輸入字段,用戶可以鍵入英寸我試圖弄清楚如何我可以打電話給json動態。所以如果人在printer1中鍵入,它將使用printer1.json。如果他們鍵入keyboard5,它將加載keyboard5 json。JSON和jQuery交換json
這裏是我的html
<input type="text" value="" class="call-json edit-device" />
,這裏是我的jQuery
$.getJSON('json/printer1.json', function (data) {
var items = [];
$.each(data[0].attributes['edgebox.stat.prop.type'], function (key, val) {
items.push(val);
});
displaySortLabel(items, "type-details");
var items = [];
$.each(data[0].attributes['edgebox.stat.prop.serial.number'], function (key, val) {
items.push(val);
});
displaySortLabel(items, "serial-number-details");
'$ .getJSON(「JSON /」 +文件名+」。json''? – 2013-02-14 21:54:11
我怎麼能有這樣的文件名+ +同步達到什麼類型的用戶到輸入字段上防抖動事件? – ndesign11 2013-02-14 21:57:35