在我的 jquery 移动应用程序中,我有一个动态生成的列表视图,我想要做的是当用户单击列表项时,我想从列表项中的隐藏字段中获取一个值并将该值传递给另一个页面,以便我可以根据该变量值进行查询。(这是多页布局)
由于我与第一页在同一个 DOM 中,我假设我可以使用普通的旧变量访问数据并传递到另一个页面。我需要知道的是,如何从动态生成的列表中获取值。任何帮助,将不胜感激。
<ul data-role="listview" class="ui-listbox" data-theme="c" role="listbox" style="margin-top:20px">
<li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-undefined">Today's Journey</li>
<?php foreach ($journeys as $journey) : ?>
<?php if ($journey['user_type'] == 0): ?>
<li class="list-item-speaker" data-icon="false">
<a href="#journeydetails?id=<?php echo $journey['journey_id']; ?>" id="journeyDetailsDriver" data-transition="flip" >
<div class="list-item-content-speaker" style="float:left">
<img src="<?php echo $journey['facebook_image']; ?>" class="thumb-speaker-small" alt="<?php echo $journey['facebook_first_name']." ".$journey['facebook_last_name']; ?>" />
<h3 style="padding-left:10px;"><?php echo $journey['from_destination']." - ".$journey['to_destination']; ?></h3>
<p style="padding-left:10px"><?php echo $journey['facebook_first_name']." ".$journey['facebook_last_name']; ?></p>
<p style="padding-left:10px; padding-top:10px; font-size:0.9em; font-weight:bold"><?php echo $journey['depart_date']; ?></p>
//VALUE I NEED FROM HIDDEN FIELD
<input type="hidden" name="journeyID" id="journeyID" value="<?php echo $journey['journey_id']; ?>">
</div>
<h3 style="float:right; margin-top:45px; color:#189ACB"><?php echo $journey['seats_available']. ' seats'; ?></h3>
</a>
</li>
</ul>