title: Delete functionality not working for MySQL table?
body: <p>My delete button isn't working to delete entries out of my table. Any ideas why? The delete script is displaying on my network tab, but when I click the Delete button, it just redirects me to the page. </p>
  
  <p>Here is my get route to display the page </p>
  
  <pre><code>router.get('/', function(req, res){
      var callbackCount = 0;
      var context = {};
      context.jsscripts = ["deletepokemon.js"];
      var mysql = req.app.get('mysql');
      getPokemon(res, mysql, context, complete);
      getMoves(res, mysql, context, complete);
      function complete() {
          callbackCount++;
          if(callbackCount &gt;= 2){
              res.render('pokemon', context);
          }
      }
  });
  </code></pre>
  
  <p>Here is my delete route </p>
  
  <pre><code>router.delete('/:id', function(req, res) {
      var mysql = req.app.get('mysql');
      var sql = "DELETE FROM pokemon WHERE id=?";
      var inserts = [req.params.id];
      sql = mysql.pool.query(sql, inserts, function(error, results, fields){
              if(error){
               res.write(JSON.stringify(error));
               res.status(400);
               res.end();
              } else{
                      res.status(202).end();
              }
          })
      })
  </code></pre>
  
  <p>Here is my delete script with jQuery </p>
  
  <pre><code>function deletePokemon(id){
          $.ajax({
                  url: '/pokemon/' + id,
                  type: 'DELETE',
                  success: function(result){
                    window.location.reload(true);
          }
       })
  };
  </code></pre>
  
  <p>Here is my handlebars file to render it all </p>
  
  <pre><code>&lt;table id="table"&gt;
      &lt;thead&gt;
          &lt;th&gt;Pokemon Name   &lt;/th&gt;
          &lt;th&gt;Evolution Level   &lt;/th&gt;
          &lt;th&gt;Move Name   &lt;/th&gt;
      &lt;/thead&gt;
     &lt;input type="text" class="search form-control" id="searchinput" placeholder="Pokemon Name"&gt;
     &lt;input type="button" class="btn btn-primary" value="Search" onclick="getUsers({{searchinput}})"&gt;
          &lt;br&gt;
      &lt;tbody&gt;
          {{#each pokemon}}
          &lt;tr&gt;
              &lt;td&gt;{{pokemonname}}&lt;/td&gt;
              &lt;td&gt;{{evolutionlevel}}&lt;/td&gt;
              &lt;td&gt;{{movename}}&lt;/td&gt;
              &lt;td&gt;&lt;button onclick="deletePokemon({{id}})"&gt;Delete&lt;/button&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a href="/pokemon/{{id}}"&gt;Update&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          {{/each}}
      &lt;/tbody&gt;
      &lt;form id="addpokemon" action="/pokemon" method="POST"&gt;
         Pokemon Name: &lt;input type="text" name="pokemonname"&gt;&lt;br&gt;
         Evolution Level: &lt;input type="text" name="evolutionlevel"&gt;&lt;br&gt;
         Move Name: &lt;select name="movename"&gt;
          {{#each move}}
          &lt;option value="{{id}}"&gt;{{primarymovename}}&lt;/option&gt;
          {{/each}}
          &lt;/select&gt;&lt;br&gt;
          &lt;input type="submit" value="Submit"&gt;
      &lt;/form&gt;
  &lt;/table&gt;
  </code></pre>