Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery client side
    text
    copied!<p>I want to make a client side with jQuery and xml as my database.</p> <p>I have found this: <code>$.twFile</code></p> <p>I don't know why my code doesn't work, because I can load the xml but I cannot add something to my xml?</p> <p>Can anybody help me how I can add something to a client side from jQuery with xml as database?</p> <p>The load method works:</p> <pre><code>var contacten = new Array(); var xmldoc=null; //xml $.ajax({ type: "GET", url: "Data.xml", dataType: "xml", success: readXml }); function readXml(xml) { xmldoc=$(xml); $(xml).find("Contacten").each(function () { $(this).find("Contact").each(function () { var Id = $(this).find("Id").text(); var Naam = $(this).find("Naam").text(); var Functie = $(this).find("Functie").text(); var Bedrijf = $(this).find("Bedrijf").text(); var Foto = $(this).find("Foto").text(); var Beschrijving = $(this).find("Beschrijving").text(); var Adres = $(this).find("Adres").text(); var Tel = $(this).find("Tel").text(); var Email = $(this).find("Email").text(); var Level = $(this).find("Level").text(); var Group = $(this).find("Group").text(); var Team = $(this).find("Team").text(); contact = new Array(Naam, Functie, Bedrijf, Foto, Beschrijving, Adres, Tel, Email, Level, Group, Team); contacten.push(contact); }); }); createGui(); }; function createGui() { $.each(contacten, function (contactId, gegevens) { $('#contactlijst').append("&lt;li id='" + contactId + "'&gt;&lt;img src='img/pics/" + gegevens[3] + "'/&gt;&lt;h2&gt;" + gegevens[0] + "&lt;/h2&gt;&lt;h3&gt;" + gegevens[1] + " at " + gegevens[2] + "&lt;/h3&gt;&lt;/li&gt;"); }); } </code></pre> <p>The problem is when I need to add something to xml:</p> <pre><code>$.twFile.save("D:\foo.txt", "test") </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload