我在我的jsp档案里有跟踪Div
<div id="myDiv">
<img alt="" src="http://localhost:8080/chartDemo/servlet/ChartDemoServlet">
</div>
我想在某个间隔内自动刷新图像 。
我尝试了
我怎样才能只刷新图像呢?
我在我的jsp档案里有跟踪Div
<div id="myDiv">
<img alt="" src="http://localhost:8080/chartDemo/servlet/ChartDemoServlet">
</div>
我想在某个间隔内自动刷新图像 。
我尝试了
我怎样才能只刷新图像呢?
<div id="myDiv" onload="JavaScript:timedRefresh(5000);">
<img alt=""
src="http://localhost:8080/chartDemo/servlet/ChartDemoServlet">
</div>
把它放在喷射针中
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
我想在某个间隙自动刷新该 div 。
用什么内容? 或者每次 img
都会更改吗?
如果是:
setInterval(function() {
$("#myDiv").html( <img alt="" src="http://localhost:8080/chartDemo/servlet/ChartDemoServlet"> );
}, 1000);
...如果 < code> img s < code> src < /code > URL 返回的数据的缓存信头是正确的(否则,浏览器可以缓存较早版本),那么完全撕掉 < code> div 的内容,然后为其指定标记,该标记应重新创建 < code> img < /code > 元素,并导致再展(如果信头是对的,则会增加)。
setInterval(function() {
// use to prevent browser cache
var d = new Date();
$("#myDiv img").attr("src", "http://localhost:8080/chartDemo/servlet/ChartDemoServlet?"+d.getTime());
}, 3000); // every 3 seconds.
You need to use window.setInterval timer. In that function you give change the img src. soemthing like this
//timer function
window.setInterval(refreshImage,1000);
function refreshImage()
{
$( #urdiveid img ).attr( src )= new location ;
}
可以用 JavaScript 超时函数完成
var t=setTimeout("functiontoCall()", 3000)
您可以在 FunctiontoCall ()
中以 myDiv
输入内容。 它可以是ajax调用或简单的 Dom 操作 。
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.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.