I am using Ajax to refresh two separte Divs at a ten second interval each:
$(document).ready(function(){
var timer, delay = 10000; // 10 seconds counted in milliseconds.
var ID = $("td :submit").val();
var info = {'userID': ID};
timer = setInterval(function(){
$.ajax({
url: "inc/ans.php",
type: "POST",
data: info,
success:function(data)
{
$("div #ans").html(data);
}
});
}, delay);
var timer, delay = 10000; // 10 seconds counted in milliseconds.
var ID = $("td :submit").val();
var Pts = '';
var info = {'userPts': Pts};
timer = setInterval(function(){
$.ajax({
url: "inc/score_I.php",
type: "POST",
data: info,
success:function(data){
$("div #scores").html(data);
}
});
}, delay);
});
But when I do this the information that the request pulls contains a <button> which when pressed adds to a database field.
<button type="submit" name="pts" href="#" value="'.$id.'">+/button>
My question is does Ajax stop form submits from happening? Or am I missing something?
