title: Updating a JSON with AJAX Jquery
body: <p>It's been hours I'm searching for a, I guess, simple answer.
  I have this JSON file </p>
  
  <pre><code> "billets": [
  {
    "idBillet": "103AHT",
    "fk_user": "Robert",
    "validite": "Pas validé",
    "titre": "Muse",
    "date": "10/04/2016",
    "heure": "21:00",
    "lieu": "Centre Bell, Montréal",
    "description": "Venez voir le groupe Muse au centre Bell au beau milieu du mois de juin! Bières fraîches recommandées pour se rafraîchir !",
    "imgURL": "http://grgrezrezrefzfz.com/AlbumMuse.png",
    "qrURL": "http://grgrezrezrefzfz.com/QRCodeMuse.png"
  }]
  </code></pre>
  
  <p>I can acess it through a local API on <a href="http://localhost:3000/billets" rel="nofollow">http://localhost:3000/billets</a></p>
  
  <p>My question is simple :
  How can I change the value of </p>
  
  <pre><code>"validite" : "Pas validé"
  </code></pre>
  
  <p>to </p>
  
  <pre><code>"validite" : "Validé
  </code></pre>
  
  <p>with Ajax Query js ? I tried POST and PUT but can't achieve what I want...</p>
  
  <p>My actual code looks like :</p>
  
  <pre><code>function validBillet() {
   var idBillet = encodeURIComponent(document.getElementById("idBillet").value);
  
  var URL = "http://localhost:3000/billets?idBillet="+idBillet;
  
          var dataObject = { 'validite': "Validé", 'validite': "Pas validé" };
  
          $.ajax({
              url: URL,
              type: 'POST',    
              data: JSON.stringify(dataObject),
              contentType: 'application/json',
              success: function(result) {
                  (data[0].validite="Validé");
                  alert("success?");
  
  
              }
          });
  
  }
  </code></pre>
  
  <p>Do you have an idea ?
  Thank you,
  Romain</p>