Hello all . I use this code roughly to call some php code then run it in an html container.

function getVote(int)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("boxcenter").innerHTML=xmlhttp.responseText;
    }
  }


xmlhttp.open("GET","poll_vote.php?vote="+int,true);

xmlhttp.send();
}

It works well although everytime i use this function in anyway it takes me back to the top of the page everytime. Does anyone know of a way to just keep people in one place on my page when i use this function. thank alot people

are you using <a href="javascript:" or onClick=""...?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.