I want to have something that loads a .jsp page into one div i have in index.jsp.
Currently i am using:
index.jsp: this function when i use the text property of the myWorkContent div place different random numbers every three seconds into the div.
<script>
$(document).ready(
function() {
setInterval(function() {
//var randomnumber = Math.floor(Math.random() * 100);
$('#myWorkContent').load('dailyImages.jsp');
// $('#myWorkContent').text(
// 'I am getting refreshed every 3 seconds..! Random Number ==> '
// + randomnumber);
}, 3000);
});
</script>
Then i tried to make it load dailyImages.jsp into that div like i did for the random number. The dailyImages.jsp is as follows:
<%@page contentType="text/html" import="java.util.Date;" %>
<font face="verdana" size="2">
Current Time :<%= new java.util.Date() %>
</font>
<img src="images/IMG_20131216_084621.jpg" style="height: 80px;" />
This div is loaded dynamically the first time, although the next times the date never changes. Can anyone help me?
I think if you add something like below it will not load it from cache. It should work if it is a cache issue. You can give it a try.
$('#myWorkContent').load('dailyImages.jsp?' + (new Date()).getTime());