说到点子上,我在使用 jquery mobile 时遇到了问题。如果我不激活来自 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>
谁能帮我解决这个问题?我非常感谢您的回答谢谢