Aquí hos dejo el codigo fuente, pero quizas no sea ese el error, disculpenme!
Código HTML:
Ver original<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> function objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
shortcut.add("left",function() {
var minus = document.getElementById("value").innerHTML;
var sum = parseInt(minus) -5;
document.getElementById("value").innerHTML = sum;
ajax=objetoAjax();
ajax.open("POST", "update.php",true);
divResultado = document.getElementById('response');
divResultado.innerHTML = '
<div id="response"></div>';
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
divResultado.innerHTML = ajax.responseText
}
}
ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
ajax.send("sumar="+sum)
});
shortcut.add("right",function() {
var more = document.getElementById("value").innerHTML;
var sum = parseInt(more) +5;
document.getElementById("value").innerHTML = sum;
ajax=objetoAjax();
ajax.open("POST", "update.php",true);
divResultado = document.getElementById('response');
divResultado.innerHTML = '
<div id="response"></div>';
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
divResultado.innerHTML = ajax.responseText
}
}
ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
ajax.send("sumar="+sum)
});