【发布时间】:2014-06-05 10:39:48
【问题描述】:
我正在尝试使用 jQuery Mobile Collapsibles 创建一个包含可折叠内容的网页。我指的是this。我想显示 $row['Host'] 作为标题和 $row['IP'] 作为内容。我的脚本不显示任何内容?我哪里错了?
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
</body>
</html>
<?php
$con = mysql_connect("127.0.0.1", "root", "pass");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("mydb", $con);
$result = mysql_query("SELECT * FROM mytbl");
?>
<?php
// display the results returned
while ($row = mysql_fetch_array($result)) {
?>
<div data-role="collapsible" data-collapsed="true">
<h3><?=$row['Host']?></h3>
<p><?=$row['IP']?><p>
</div>
<?php } ?>
【问题讨论】:
标签: javascript php jquery jquery-mobile