0

是将数据库信息加载并显示到 div 上吗?我有这个代码here

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<title></title>
<link rel='stylesheet' href='assets/style.css' />
</head>
<?php include('includes/bootstrap.php'); ?>
<body>
<div id='box' class='hidden'>
    <div id='box_menu'>
        <div class='close_box' id='close_this_box'>X</div>
        <div id='box_content'></div>
    </div>
</div>
<?php
$sql = "SELECT * FROM stars_info";
$que = $db->prepare($sql);
try{$que->execute();
    while($row = $que->fetch(PDO::FETCH_BOTH)) {
        echo
            "<a href='#' id='{$row['link_name']}' class='click' >".
            "<div style='position: absolute; top: {$row['top']}px; left: {$row['left']}px;'></div></a>\n";
    }
} catch(PDOException $e){ $e->getMessage(); } 
?>
</body>
</html>
<script type='text/javascript'>
$(document).ready(
    function() {
        $('.click').hover(function() {
            $('#box_content').load('content.php');
            $('#box').removeClass('hidden')
        });
    }
);
$('#close_this_box').click(function(){
    $('#box').addClass('hidden')
});
</script>

但我不知道如何将链接中的信息传递给 content.php 然后显示它。有人可以帮我吗?

4

0 回答 0