javascript - how to read & write external xml file in apache cordova? -


i creating android app. want use xml file store little amount of data short period of time.. able read xml using ajax.get() method file not able write xml.. please me so..

if want store little amount of data , using cordova, use , set local storage:

localstorage.setitem("lastname", "smith"); 

and

var agentsmith=localstorage.getitem("lastname"); 

as w3school says:

with local storage, web applications can store data locally within user's browser.

but if want use xml, do:

var v = new  xmlwriter();    v.writestartdocument(true);    v.writeelementstring('test','hello ');    v.writeattributestring('foo','bar');    v.writeenddocument();    console.log( v.flush() ); 

and obtain:

<?xml version="1.0" encoding="iso-8859-1" standalone="true" ?> <test foo="bar">hello world</test> 

like here create , modify xml file using javascript


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -