如何从其他页面添加div?

时间:2010-01-30 01:47:40

标签: javascript html

2 个答案:

答案 0 :(得分:3)

这项任务并不像应有的那样困难,感谢光荣的jQuery图书馆......

$(document).ready(function() {
  // Repeat this for each of your URLs
  $.get("URL", function(data) {
    var resp = $(data); // Now you can do whatever you want with it
    $("#ID_OF_DIV", resp).appendTo("body");
  });
  // End Repeat

  setTimeout(function() {
    location.reload(true);
  }, 10000); // Refresh every ten seconds
});

答案 1 :(得分:1)