I use AJAX to communicate with a PHP file that queries a MySQL database and returns the information in JSON.
Expand|Select|Wrap|Line Numbers
- function sendQuerystring2(url,mod,columna)
- {
- http2.open("GET", url, true);
- if (mod == "tabla") {
- http2.onreadystatechange = function (){
- if (http2.readyState == 4) {
- hide('cargando');
- if (http2.status == 200) {
- obj_detalle = eval('(' + http2.responseText + ')');
- crear_tabla(columna);
- }
- } else {
- show('cargando');
- }
- }
- }
Expand|Select|Wrap|Line Numbers
- {"items":[{"id":"1","titulo":"Prueba"}]}
I have tried an alert(http2.responseText) and it has the correct content.
does anyone know a fix to this?
many thanks.