vendredi 1 mai 2015

Ignoring ' from javascript code, SQLite

I have a french category named piqûres d'insectes that I am pulling from a SQLite database. Unfortunately, the ' in the category keeps breaking my javascript code, as seen in my pictures where it turns my breadcrumbs into undefined (half the word is missing as well clearly from the apostrophe). Is there a way I can pull this as just text so it does not break my code?

enter image description here

enter image description here

Javascript:

function txSuccessListAddSymptoms(tx,results) {
    //console.log("Read Additional Symptoms success");
    var category = getUrlVars().category;
    var mainsymptom = getUrlVars().mainsymptom;
    var len = results.rows.length;
    var addSymp;
    for (var i=0; i < len; i = i + 1) {
        addSymp = results.rows.item(i);

    };
    $('#addSymps').listview('refresh');
}

Aucun commentaire:

Enregistrer un commentaire