id;?> be-6ren">
gpt4 book ai didi

javascript - 如何在codeigniter中使用引导弹出窗口

转载 作者:行者123 更新时间:2023-11-28 05:35:24 24 4
gpt4 key购买 nike

大家早上好,我还在学习如何在 CI 中使用引导弹出窗口,这里是我已经尝试过的代码

<?php foreach ($tbl_bet_spot as $data) {?>  
<tr>
<td><a class="loveit" href="javascript:;" data-toggle="popover" data-content="Some content inside the popover" ><?php echo $data->round_id;?></a>
<td><a class="loveit" href="javascript:;" rel="<?php echo site_url('account/detail_player_id/'.$data->id);?>"><?php echo $data->id;?></td>
<td><?php echo $data->bet;?></td>
<td><?php echo $data->total_bet;?></td>
<td><?php echo $data->win;?></td>
<td><?php echo $data->lose;?></td>
</tr>
<?php } ?>

关于脚本在这里

<script type="text/javascript">
$('.loveit').click(function(e){
e.preventDefault();
var targetUrl = $(this).attr('rel');
$.ajax({
url: targetUrl,
type: "GET",
success:function(html){
$(document).ready(function(){
//alert("done");
$('#view-list-round-history').html(html);
$('[data-toggle="popover"]').popover();
});
},
error:function (){
alert("testing error");
}
});
});

在此之前,我已经像这样创建了 <td><a class="loveit" href="javascript:;" rel="<?php echo site_url('account/detail_player_id/'.$data->id);?>"><?php echo $data->id;?></td>结果是,它显示在html $('#view-list-round-history').html(html);

问题是,当我单击此 <td><a class="loveit" href="javascript:;" data-toggle="popover" data-content="Some content inside the popover" ><?php echo $data->round_id;?></a> 时,我仍然尝试创建引导弹出窗口我想在弹出窗口中显示来自 Controller 的结果查询,但此代码不起作用。谢谢大家

最佳答案

<?php foreach ($tbl_bet_spot as $data) {?>  
<tr>
<td><a class="loveit" href="javascript:;" data-toggle="popover" data-content="Some content inside the popover" ><?php echo $data->round_id;?></a></td>
<td><a class="loveit" href="javascript:;" rel="<?php echo site_url('account/detail_player_id/'.$data->id);?>"><?php echo $data->id;?></td>
<td><?php echo $data->bet;?></td>
<td><?php echo $data->total_bet;?></td>
<td><?php echo $data->win;?></td>
<td><?php echo $data->lose;?></td>
</tr>
<?php } ?>

在以下语句中遗漏了结束 td,

<td><a class="loveit" href="javascript:;" data-toggle="popover" data-content="Some content inside the popover" ><?php echo $data->round_id;?></a>

关于javascript - 如何在codeigniter中使用引导弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39407790/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com