在PHP结果中添加复选框,并在一段时间后使用java逐个打开它们

在PHP结果中添加复选框,并在一段时间后使用java逐个打开它们,php,javascript,function,checkbox,Php,Javascript,Function,Checkbox,这是我的JavaScript function thisimg(id,recordid) { var newid = "addlink_"+id; var countid = "count_"+id; var url = "../updateclick.php"; $.post(url,{dbid:recordid},function(data) { document.getElementById(countid).innerHTML = data; }); var url =document

这是我的JavaScript

function thisimg(id,recordid)
{
var newid = "addlink_"+id;
var countid = "count_"+id;
var url = "../updateclick.php";
$.post(url,{dbid:recordid},function(data) {  document.getElementById(countid).innerHTML = data; });
var url =document.getElementById(newid).value;
window.open (url,"mywindow","status=1");
}
这是我的PHP echo

echo "<div class='title box'  onclick='thisimg(".$counter.",".$row['id'].")'><div style='float:left'><img src='".$imgpath."' alt='SimCity Social $name' title='$caption' height='50' width='50' /></div> <div class='click' style='float:right;'><b>Clicks <br/> <div id='count_".$counter."'> ".$click." </div> <input type='hidden' id='addlink_".$counter."' value='".$app_link."' rel='nofollow'</b></div><div style='float:left; width:100px; overflow:hidden; white-space: pre;'> <b> ".$name."</b><br/>".$beforetime."</div></div>";

echo“Clicks
“$click。”注意,您有一个title和一个box类(同一标记有两个单独的类),空格是html标记的class属性的分隔符

这是一个复选框:

<input type="checkbox" id="foo" value="bar" />
使用上面的(未测试)代码,这是第四步

最后,您应该打开窗口,此链接可能会帮助您:

致以最良好的祝愿, 拉霍斯·阿尔帕德

$('.box > input[type="checkbox"]').each(function(){
   if ($(this).prop("checked")
   {
      var url = $(this).parent().find(".app-link").val();
      //Do whatever you want with this URL...
   } 
});