title: I need some help getting parameters to go through with my AJAX call
body: <p>I'm making a call with ajax to my db to get some data. And I try to limit it to a specific Id. And I got the backend working. it works when I visit the specific localhost url or when I call it from Postman. I then get the expected value. However when I try to make a call from my client with AJAX I just don't get anything at all. I got into a thing where sometimes it would work and sometimes it didn't.</p>
  <pre><code>const GetUserById = (id) =&gt; {
      let url = &quot;/Users/1&quot;;
      $.get(url, (gotUser) =&gt; {
          alert(gotUser.id);
      })
  }
  </code></pre>
  <p>I have this method that I just hardcoded to go to /Users/1 for testing purposes. And when I call this in postman or go to localhost:8080/Users/1 I get the thing I expect. However here It just doesn't go anywhere at all.</p>
  <pre><code>app.get(&quot;/Users/:id&quot;, (request, response) =&gt; {
      let sqlCode = &quot;select Id, Username, [Password], Credits from Users Where Id = &quot; + request.params.id;
  
      sql.query(connString, sqlCode, (error, result) =&gt; {
  
          if (error) {
              console.log(error);
          }
          else {
              response.json(result);
          }
      });
  });
  </code></pre>
  <p>The server side if that's interesting.</p>
  <p>EDIT: added a try catch like this. it doesn't even get to the catch. It get's to the line that's $.get(url, (gotUser) =&gt; { then it goes to the end of the function and doesn't get anything.</p>
  <pre><code> try {
          $.get(url, (gotUser) =&gt; {
              alert(gotUser.id);
          })
      } catch (error) {
          console.log(error);
      }
  </code></pre>