Hi,
I am really confused by this few lines of code that should work in my opinion. Div is updating when using .html, but not when using custom script.
I have a couple files, index.php and test.php
index contains:
$(document).ready(function () {
setInterval(function () {
$(function () {
$.ajax({
url: 'test.php',
dataType: 'json',
cache: false,
success: function (data) {
// custom script that displays parsed info goes here, doesn't work
$("#div").html(data); // works and updates
}
});
});
}, 10000);
});
test.php contains json string.
index.php displays, and updates the parsed info in a div just fine, however the script using the data populated by json doesn't refresh.
Any help will be greatly appreciated.
Thanks