I have the following Code which works good now,
<!DOCTYPE html>
<html>
<body>
<div id="one">
echo "data 1";
<input type="hidden" id="one" name ="one" value="'.$one.'">
</div>
<div id="two">
echo "data 1";
<input type="hidden" id="two" name="two" value="'.$one.'">
</div>
</body>
</html>
for each DIV I have data 1 2 3...more comes from MySQL php query. So, when the Hidden Id = one delay some second and show the next result data 2, until we get the input hidden to one again. that all come from database. automatically. I have all that working.
I am able to use ajax to show the data, but when i come to read the Input value and change accordingly. I have problem...
I have tried..
var value1 = $('one').attr( "value" ); //
var value2 = $('two').attr( "value" ); //
(function data() {
$.ajax({
url: 'data.php',
if (value1 == 'one') {
success: function(data) {
$('#one').html(data);
},
}
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(data, 5000);
}
});
})();
But it seems not working....