title: Can not find error in java script "Uncaught SyntaxError: missing ) after argument list"
body: <p>Give this code 10 seconds and it'll give the following error:</p>
  <blockquote>
  <p>{
  &quot;message&quot;: &quot;Uncaught SyntaxError: missing ) after argument list&quot;,
  &quot;filename&quot;: &quot;https://stacksnippets.net/js&quot;,
  &quot;lineno&quot;: 1,
  &quot;colno&quot;: 28
  }</p>
  </blockquote>
  <p>It seems to be pointing to something in a library, but it completely stops my code from running. I want this code to check whether my server is up and then see if there have been any changes to a display library, if there have been then it updates the page.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function checkServerStatus2(lastUpdated, display_id) {
    var img = document.createElement("img");
    img.onload = function() {
      //server reachable
      var xhttp = new XMLHttpRequest();
      xhttp.open("POST", "/checkLinks/" + display_id, true);
      xhttp.setRequestHeader("Content-Type", "application/json");
      xhttp.onreadystatechange = function() {
        if (this.readyState == 4 &amp;&amp; this.status == 200 &amp;&amp; this.statusText == 'OK') {
          var json = JSON.parse(xhttp.responseText);
          var displayLastUpdated = json.lastUpdated;
          if (displayLastUpdated &gt; lastUpdated) {
            //refresh page if server has been updated
            alert("RELOADING");
            location.reload(1);
          }
          //else do nothing
          alert("no updates");
        }
        //else server didn't respond do nothing
        alert("server sent picture but not json");
      };
      xhttp.send();
      img.onerror = function() {
        //server unreachable
        alert('Server Down!');
      };
      //image to pull to check if server is reachable
      img.src = "/static/img/aol.png?t=" + Date.now();
    };
  }
  
  //Included old function that works, just trying to get it to check a date with my server
  function checkServerStatus() {
    var img = document.createElement("img");
    img.onload = function() {
      //alert("Yay");
    };
    img.onerror = function() {
      //server unreachable
      alert('Server Down!');
    };
    //image to pull to check if server is reachable
    img.src = "/static/img/aol.png?t=" + Date.now();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;!--Kill Favicon request --&gt;
    &lt;link rel="icon" href="data:,"&gt;
  
    &lt;title&gt;Home: Home&lt;/title&gt;
  
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;!--My styles sheet --&gt;
    &lt;link rel="stylesheet" type="text/css" href="/static/styles.css"&gt;
    &lt;!-- My Java Scripts --&gt;
    &lt;script src="/static/js/moment.min.js"&gt;&lt;/script&gt;
    &lt;!-- Script from server for moment text generator --&gt;
    &lt;script src="/static/scripts.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  
  
  
  &lt;script&gt;
    var myVar = setInterval("checkServerStatus2(2020-08-22 20:24:53.520739, 13)", 10 * 1000);
  &lt;/script&gt;
  
  &lt;div class="full-screen-scroller" style="width: 400px;" background-color: powderblue;&gt;
    &lt;div id="myCarousel" class="carousel slide" data-ride="carousel"&gt;
      &lt;!-- Indicators --&gt;
      &lt;ol class="carousel-indicators"&gt;
  
  
  
        &lt;li data-target="#myCarousel" data-slide-to="0" class="active"&gt;&lt;/li&gt;
  
  
  
  
        &lt;li data-target="#myCarousel" data-slide-to="1"&gt;&lt;/li&gt;
  
  
  
  
        &lt;li data-target="#myCarousel" data-slide-to="2"&gt;&lt;/li&gt;
  
  
  
      &lt;/ol&gt;
  
      &lt;!-- Wrapper for slides --&gt;
      &lt;div class="carousel-inner"&gt;
  
  
  
        &lt;div class="item active"&gt;
          &lt;img style="width: 100%; max-height: 400px;" src="https://media.giphy.com/media/r1fDuPIcs18d2/giphy-downsized-large.gif" alt="Snoop Dog!"&gt;
          &lt;div class="carousel-caption"&gt;
            &lt;h3&gt;Snoop Dog!&lt;/h3&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
  
  
  
        &lt;div class="item"&gt;
          &lt;img style="width: 100%; max-height: 400px;" src="https://media.giphy.com/media/WZ5tDWAQrUeuk/giphy.gif" alt="Wowzers!"&gt;
          &lt;div class="carousel-caption"&gt;
            &lt;h3&gt;Wowzers!&lt;/h3&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
  
  
  
        &lt;div class="item"&gt;
          &lt;img style="width: 100%; max-height: 400px;" src="https://media.giphy.com/media/WZ5tDWAQrUeuk/giphy.gif" alt="wowzers2"&gt;
          &lt;div class="carousel-caption"&gt;
            &lt;h3&gt;wowzers2&lt;/h3&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
  
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>