Ajax Double Call
- by Lordareon
with this function
<script type="text/javascript">
function ajaxcall(div, page)
{
if (window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(div).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",page,true);
xmlhttp.send();
}
</script>
i use my ajax. But in the page i call 2 times this function:
<script type="text/javascript">ajaxcall("menu", "perfil.php");</script>
<script type="text/javascript">ajaxcall('mapadiv', "map2.php");</script>
But happens that only one of them works, if i remove one the other works. What im doing wrong? Thanks!