java - Javascript won't post into DIV? -
so console shows data being sent , received reason (probably conditional) nothing posted in specified div tag
var var_iddatacheck = <?php echo $javaid; ?>; var var_idcheck = parseint(var_iddatacheck); //datacheck var var_numdatacheck = <?php echo $datacheck; ?>; var var_numcheck = parseint(var_numdatacheck); function activitycheck() { $.ajax({ type: 'post', url: 'feedupdate.php', data: {function: '3test', datacheck: var_numcheck, javaid: var_idcheck}, success: function (check) { console.log(check); var verify = json.parse(check); if (var_idcheck < verify.id) { var_idcheck = verify.id; (var i=0;i<var_idcheck;i++){ $('#datacheck').html(verify[i]); } } settimeout(activitycheck(),5000); }, error: function(check) { console.log(check); settimeout(activitycheck(),5000); } }); } $(document).ready(function() { activitycheck(); }); // document ready
your id json string, , comparing integer
try
var verify = json.parse(check); if (var_idcheck < parseint(verify.id)) { var_idcheck = parseint(verify.id); (var i=0;i<var_idcheck;i++){
Comments
Post a Comment