jquery Mobile Select with data-native-menu=“false” 和 PHP 数组不


jquery mobile select with data-native-menu="false" and php array does not work

我无法让它工作。带有 jqm data-native-menu="false" 的 php 数组不会显示所有项目,而只显示第一个和最后一个项目。如果数据原生菜单="true",则显示所有项目。我该如何解决它?

<?php
$fooArray = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday');
?>
<!DOCTYPE html>
<html>
<head>
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="js/jquery.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
</head>
<body>
<section id="main" data-role="page">
    <header data-role="header" data-theme="b"><h1></h1></header>
    <div data-role="content">
        <div data-role="fieldcontain">
            <label for="select-choice-1" class="select">Choose the day:</label>
            <select name="select-choice-1" id="select-choice-1" data-native-menu="false">
            <?php foreach ($fooArray as $value) { echo '<option value=>'.$value.'</option>'; } ?>
            </select>
        </div>                
    </div>
    <footer data-role="footer" data-theme="b"><h1></h1></footer>
</section>
</body>

将 foreach 循环更改为此

<?php foreach ($fooArray as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } ?>