English 中文(简体)
四. 散射体最新含量
原标题:Update content of div auto
  • 时间:2011-11-09 09:44:45
  •  标签:
  • jquery

我正试图用这一文字自动更新一部分内容:

function update() {
  $.get("authentication/notifications.php", function() {
    $(".notificationBox").html();
    window.setTimeout(update, 10000);
  });
}

但出于某种原因,它不工作。 页: 1

通知。 php必须从数据库中获取一些数据。 我知道,这getting了,讨论一下它所展示的网页的正常更新。

通知 通知中载有方框。 php只是一个 for(ach)的正常 d。

My notifications.php looks like this:

<?$notifications = $db->notifications();

foreach($notifications as $notifications):?>
   <div class= notificationBox ><?=$notifications[ pushCommentsContent ];?></div>
<?endforeach;?>

I want the DIV to be outputted on update, or to be added to the existing.

最佳回答

If you use load, it can do the sorting for you:

$( .notificationBox ).load( authentication/notifications.php .notificationBox , function() {
  window.setTimeout(update, 10000);
});

这里将进行探测。 带有班级通知的内容 方框和在你本页上插入一个内容,并附有班级通知。 方框。

因此,你想要更新的内容类别必须具备以下类别:


您没有插入你获得的电线,也没有:

function update() {
  $.get("authentication/notifications.php", function(newdata) {
    $(".notificationBox").html(newdata);
    window.setTimeout(update, 10000);
  });
}
问题回答

但出于某种原因,它不工作。 页: 1

这是因为你的代码与OMM有关。 也许你想通过一个论点到html()?





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签