<product>
从文本输入中接收“天”后,如何<availabilities>
使用 jQuery 仅从同一日期显示?也许使用.siblings()
?
<?xml version='1.0' encoding='iso-8859-15'?>
<timetable>
<date>
<day>22-01-2013</day>
<availabilities>
<availability>
<starttime>10:00</starttime>
<endtime>13:00</endtime>
<startplace>Funchal</startplace>
<endplace>Funchal</endplace>
<resource>Excursões na Madeira</resource>
<idstartplace>18</idstartplace>
<idendplace>18</idendplace>
<idperiodoconsumo>13289</idperiodoconsumo>
<idproduct>23</idproduct>
<product>EXC_SANT</product>
<idtimeperiod>11523</idtimeperiod>
<idavailability>3561</idavailability>
</availability>
<availability>
<starttime>10:00</starttime>
<endtime>13:00</endtime>
<startplace>Funchal</startplace>
<endplace>Funchal</endplace>
<resource>Excursões na Madeira</resource>
<idstartplace>18</idstartplace>
<idendplace>18</idendplace>
<idperiodoconsumo>13290</idperiodoconsumo>
<idproduct>33</idproduct>
<product>foot</product>
<idtimeperiod>11524</idtimeperiod>
<idavailability>3593</idavailability>
</availability>
<availability>
<starttime>10:00</starttime>
<endtime>13:00</endtime>
<startplace>Funchal</startplace>
<endplace>Funchal</endplace>
<resource>Excursões na Madeira</resource>
<idstartplace>18</idstartplace>
<idendplace>18</idendplace>
<idperiodoconsumo>13289</idperiodoconsumo>
<idproduct>22</idproduct>
<product>VLT_ILHA</product>
<idtimeperiod>11523</idtimeperiod>
<idavailability>3561</idavailability>
</availability>
</availabilities>
</date>
<date>
...
</date>
...
这是我的成功:功能:
function parseStuff(data){
$(data).find('date').each(function(){
var day = $(this).find('day').text();
if (day==decodeURI(iHash[3])){
alert('Date matches!');
}
});
}
我会很感激一些帮助,我不知道该怎么做.. :|