Basically I have a java application that can display the data it outputs onto a webpage. I have a div containing tables, each table representing one java object and its values, after a period of time I want AJAX to refresh that div with the new data. Problem, I'm using a java servlet as certain actions have to be performed on the data before it can be displayed on the page(they are snmp objects so I have to use snmp methods to get the values of their OIDs).
It seemed to work at first but I noticed the refresh interval seemed to get shorter each time:
<script>
$(document).ready(function() {
window.setInterval(function() {// set time limit for AJAX call
$(function() {
$('#id').load('servlets');
});
}, 5000);
});
</script>
I looked at the page with firebug and noticed that the whole html doc is being put into the div where I want the info to be refreshed. Is it possible to use the .load() on a servlet call to get the div I want from its response? I.E $('#id').load('servlet #id') or is there an easier way of getting the div I want from the response?