Foros del Web » Programando para Internet » Android »

Fallo en scrip phonegap

Estas en el tema de Fallo en scrip phonegap en el foro de Android en Foros del Web. Buenas: Estoy creando un script javascrip para phonegap. Este recorre un archivo xml en mi servidor web, y quiero que guarde las respuesta En local ...
  #1 (permalink)  
Antiguo 08/03/2013, 08:35
 
Fecha de Ingreso: abril-2012
Mensajes: 13
Antigüedad: 12 años
Puntos: 0
Fallo en scrip phonegap

Buenas:
Estoy creando un script javascrip para phonegap.
Este recorre un archivo xml en mi servidor web, y quiero que guarde las respuesta En local en un archivo xml.
Me da fallo, y ya estoy loco.
A ver si veis cual es el fallo.


Gracias
$(document).ready(function(){
var tabla
$.get("http://192.168.0.193/json/landmarks.php", function (xml) {
$(xml).find("evento").each(function () {
var fecha = $(this).find('fecha').text();
var titulo = $(this).find('titulo').text();
var texto1 = $(this).find('texto1').text();
var texto2 = $(this).find('texto2').text();

tabla='<enventos><evento><fecha>' + fecha + '</fecha><titulo>'+ titulo + '</titulo><texto1>'+ texto1 +'</texto1><texto2>' + texto2 +'</texto2></evento>';


// Escribir un archivo de texto
window.requestFileSystem(window.LocalFileSystem.PE RSISTENT, 0,
function (fileSystem) {
fileSystem.root.getFile('archivo.xml', {create: true},
function (fileEntry) {
fileEntry.createWriter(function (writer) {
writer.write('<?xml version="1.0" encoding="utf-8"?>' + tabla + '</eventos>');
});
},
onError);

});
})
});

Etiquetas: fallo, java, phonegap, scrip, xml
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:35.