% function getData(info){ var data = []; switch (info.level) { case "area": data.push("data-level='"+info.level+"'"); data.push("data-area='"+info.keyword+"'"); break; case "country": data.push("data-level='"+info.level+"'"); data.push("data-country='"+info.keyword+"'"); data.push("data-placeShowName='"+info.name+"'"); break; case "region": data.push("data-level='"+info.level+"'"); data.push("data-country='"+info.country+"'"); data.push("data-region='"+info.keyword+"'"); data.push("data-placeShowName='"+info.name+"'"); break; case "subregion": data.push("data-level='"+info.level+"'"); data.push("data-country='"+info.country+"'"); data.push("data-subregion='"+info.keyword+"'"); data.push("data-placeShowName='"+info.name+"'"); break; case "city": data.push("data-level='"+info.level+"'"); data.push("data-country='"+info.country+"'"); data.push("data-city='"+info.keyword.replace(/\-/ig,",")+"'"); data.push("data-placeShowName='"+info.name+"'"); break; case "scene": data.push("data-level='"+info.level+"'"); data.push("data-scenes='"+info.scene_sn+"'"); data.push("data-placeShowName='"+info.name+"'"); break; } if (info.name == "全區") { data.push("data-placeShowName='"+info.categroy_name+"'"); } else { data.push("data-placeShowName='"+info.name+"'"); } data.push("data-level-no='"+info.level_no+"'"); /* if (typeof(info)!="undefined") { for (var key in info) { if ( ["sn","show","region"].indexOf(key)<0){ var inputKey = key; switch (key) { case "keyword": inputKey = "place"; break; case "name": inputKey = "placeShowName"; break; } data.push("data-"+inputKey+"='"+info[key]+"'"); } } } */ return data.join(" "); } %>