Show Next Value From Mysql Php In Ajax
I have the following Code which works good now,
echo 'data 1';
Solution 1:
A couple of small modifications may help this work:
<!DOCTYPE html><html><body><divid="div-one"><?phpecho"data 1"; ?>;
<inputtype="hidden"id="one"name ="one"value="<?php$one; ?>;"></div><divid="div-two"><?phpecho"data 2"; ?>;
<inputtype="hidden"id="two"name="two"value="<?php$two; ?>;"></div></body></html>
Javascript:
var value1 = $('#one').val();
var value2 = $('#two').val();
(functiondata() {
$.ajax({
url: 'data.php',
success: function(data) {
if (value1 == 'one') {
$('#div-one').html(data);
}
},
complete: function() {
// Schedule the next request when the current one's completesetTimeout(data, 5000);
}
});
})();
Post a Comment for "Show Next Value From Mysql Php In Ajax"