我的弹出窗口代码是 -
<script type="text/javascript">
function call(URL,ids,url_id,user_id,plan_id) {
popup = window.open(URL, URL,'minimizable=no, scrollbars=no, resizable=no, titlebar=no');
setTimeout(function(){
popup.close()
$('#'+ids).attr("href", "#");
$.ajax({
type: "POST",
url: "index.php?act=url_records",
data: {
user_id: user_id, url_id: url_id, plan_id: plan_id
},
success: function (data) {
if(data == "Ok"){
}
},
});
}, 5000);
}
</script>
<div id="page-wrapper" class="well" style="border:solid 1px #E8E7FE;">
<div class="container-fluid"><br />
<div class="well row bg-title">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h4 class="page-title" style="color:#AE1534;">Inbox</h4>
</div>
</div>
<div class="row">
<div class="col-md-12 col-xs-12">
<div class="well white-box" style="overflow-x:auto;"><br />
{$iv=1}
{foreach $records as $value}
{$iv}:
<a href="javascript:call('{$value.url_name}','id_{$iv}','{$value.url_id}','{$smarty.session.UserId}','{$smarty.session.PlanId}')" style="color:#0000C1; text-decoration:underline;" id="id_{$iv}">{$value.url_name}</a>
<br /><br />
{$iv++}
{/foreach}
</div>
</div>
</div>
</div>
</div>
当用户点击链接时,弹出窗口打开,5秒后弹出窗口自动关闭,记录保存在数据库中。 但问题是这样 - 当用户必须关闭打开的弹出窗口但记录也保存在数据库中。 我想要 如果用户必须关闭打开的弹出窗口,则记录不应保存在数据库中......