I am working on a java project and I need to add cookie in the browser to register a record of points of the person and turns it into a variable "a".
I have everything working ... just missing it!
the project is a play test of reflex and just missing that part.
I put the most important (the start and the function that I want to change, respectively)
the function is enabled by a button
the variable "a" is defined as 10000000
ps: the project is in Portuguese because I am Brazilian!
var startTime=new Date();
var endTime=new Date();
var startPressed=false;
var bgChangeStarted=false;
var maxWait=20;
var timerID;
var a=10000000
var colors=new Array("red")
(...)
function stopTest()
{
if(bgChangeStarted)
{
endTime=new Date();
var responseTime=(endTime.getTime()-startTime.getTime())/1000;
var responseTime2=(endTime.getTime()-startTime.getTime());
if (a > responseTime2){
a=responseTime2
c="#00FF00"
}
if (a < responseTime2){
a=a
c="red"
}
if (document.all)
document.all.reflex.style.backgroundColor="green";
else if (document.getElementById)
document.getElementById("reflex").style.backgroundColor="green";
else if (document.layers)
document.reflexns.document.reflexns_sub.document.bgColor="green";
//alert("Tempo de resposta: " +responseTime2 +" ms" + "\n" + remark(responseTime));
document.getElementById("resultado").innerHTML=('<font color="'+c+'" size="7">'+responseTime2+' ms</font><br><font color="#00FF00">'+ remark(responseTime)+' ------ Melhor tempo: </font><font color="blue">'+a+" ms<br>Best do Windsdon: 176 ms</font>");
startPressed=false;
bgChangeStarted=false;
}else{