不能't显示数据从mysql表jquery移动


Can't Display data from mysql on table jquery mobile

到点,我有麻烦的jquery移动。如果我从jquery激活源,我的脚本运行。但是,如果我激活jquery的源代码,我的php脚本不工作。

这是我的脚本

        <html> 
            <head> 
            <title>Security</title> 
            <meta name="viewport" content="width=device-width, initial-scale=1"> 
            <!--script for jquery source-->
            <link rel="stylesheet" href="jqm2/jquery.mobile-1.3.1.min.css" />
            <script src="jqm2/jquery.js"></script>
            <script src="jqm2/jquery.mobile-1.3.1.min.js"></script>
             <!--script for jquery source-->
            </head> 
        <body> 
        <div data-role="page" id="BahanBaku" class="type-interior" data-theme="c">
        <div data-role="header">
            <h1>Bahan Baku</h1>
        </div><!-- /header -->
    <div data-role="content">   
         <form method="post" action="BahanBaku.php">
           <!--this select button-->
         <select name="BARANG" data-native-menu="false" onchange="this.form.submit()">
            <option value="">Pilih Nama Barang</option>
            <option value="A">A</option>
            <option value="B">B</option>

         </select>
            <!--this select button-->
         </form>
         <?php
         //this script for get data from mysql based the select button
            if(isset($_POST[BARANG])){
                $barang = $_POST[BARANG];
                //print_r($_POST);
                $sql2 = "SELECT *  FROM tb_spekbaku WHERE namaBarang = '$barang' ";
                $hasil2 = mysql_query($sql2) or die ('Error = '. mysql_error());
                $data2 = mysql_fetch_array($hasil2);

            }
            ?>
       <table data-role="table" id="table-column-toggle" data-mode="columntoggle" class="ui-responsive table-stroke">
         <thead>
           <tr>
             <th>Jenis Spec</th>
             <th>Spec</th>
           </tr>
         </thead>
         <tbody>
           <tr>
             <th>Lain lain</th>
             <td><?php echo $data2[lain];?></td><!--this is the line when jquery inactive the result showed, but if jquery active the result not show again-->
           </tr>
          </tbody>
          </table>    
        </div><!--end off  content-->
        <div data-role="footer">
            <h4>Bla bla </h4>
        </div><!-- /footer -->
    </div><!--end of page-->    
</body>
</html>

谁能帮我解决这个问题?非常感谢你的回答由于

默认情况下,jQM中的Ajax会自动处理表单提交。

要防止这种行为,请将data-ajax="false"属性添加到form元素中。

<form method="post" action="BahanBaku.php" data-ajax="false">