Hi, i'm new in developer with PHP/ JavaScript e HTML.
I try access a page with the grid, but return nothing, just my html. If i open the page without ajax, the grid did open normal.
The code than used is:
if (xmlRequest.readyState == 4)
{
document.getElementById("conteudo").innerHTML = xmlRequest.responseText;
}
Sorry by the horrible english…
Hello,
I dont fully understand your question. Perhaps you need to debug.
Use firefox->firebug->net->ajax-call of grid->response. You will see the output there, in case of any error. It should be proper JSON format data in order to render grid
Review this tutorial for debugging https://phpgrid.desk.com/customer/portal/articles/926266
__
Let me explain better, i trying call a page .php with the grid. When i call the page by "<a hef", it's fine, but if i call using ajax, nothing happens.
Looking the source in the browser, i see the codes of my page, but in the div( that is the place of the grid) is blank.
The code of AJAX, that i using is:
function GetXMLHttp()
{
if(! window.XMLHttpRequest)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
xmlHttp = new XMLHttpRequest();
}
return xmlHttp;
}
var xmlRequest = GetXMLHttp();
function mudancaEstado()
{
if (xmlRequest.readyState == 4)
{
document.getElementById("conteudo").innerHTML = eval(xmlRequest.responseText);
}
if (xmlRequest.readyState == 1)
{
document.getElementById("conteudo").innerHTML = "Carregando…";
}
}
function abrirPag(valor)
{
var url = valor;
xmlRequest.onreadystatechange = mudancaEstado;
xmlRequest.open("GET", url, true);
xmlRequest.send(null);
return url;
}