如何在时间线javascript代码中集成php id

时间:2015-09-21 15:22:11

标签: php jquery html timeline

我在page.php上有代码

<script type="text/javascript">
    $(document).ready(function() {
        var timeline_data = [{
            content:' <div class="classdiv"> <div id="proID" >$rows[$id]</div> </div> '; ?>, 
        }];
        $().product('.classdiv');
    });
</script>

当时间轴加载div时, div <div class="classdiv"> <div id="proID" >$rows[$id]</div> </div>具有正确的ID。

HTML正确生成

<div class = "classdiv"> <div id = "proID"> 123 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 243 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 423 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 743 </ div> </ div>,

但是page.php只显示所有div内容中的单个ID

<div class = "classdiv"> <div id = "proID"> 123 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 123 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 123 </ div> </ div>,
<div class = "classdiv"> <div id = "proID"> 123 </ div> </ div>,

请告诉我解决方案是什么?

0 个答案:

没有答案