title: Javascript SyntaxError: Unexpected token '}'
body: <p>I have the following simple code, however for some reason it trows a Unexpected token "}" error, and I'm not entirely sure why.
  I have the following code to generate the buttons </p>
  
  <pre><code>var OverlayMessage = ("Do you want to test these settings? &lt;br&gt; &lt;h6&gt;" + protocol + ":" + systemcodeSend + "-" + unitcode + " sending " + state + '&lt;/h6&gt; &lt;br&gt; &lt;a id="btnGreen" onclick="checkIfSettingsWork("' + protocol +'", "'+ systemcodeSend +'", "'+ unitcode +'", "'+ state +'");"&gt;Yes&lt;/a&gt; &lt;a id="btnRed" onclick="toggleVisibility(\'overlayAddDevice\')"&gt;No&lt;/a&gt;');
          console.log(OverlayMessage);
          overlayMessage(OverlayMessage);
  </code></pre>
  
  <p>The output of console.log is as followed</p>
  
  <pre><code>&lt;a id="btnGreen" onclick="checkIfSettingsWork("pollin", "31", "14", "on");"&gt;Yes&lt;/a&gt;
  </code></pre>
  
  <p>The strange thing is, if I run from the debugger, it works fine without errors. However when being ran trough the onclick event it trows the Unexpected token error.</p>
  
  <p>The function checkIfSettingsWork is not even being ran, I checked this by letting it log to console, and that is returning nothing when being ran by the onclick event however it works when I run the following javascript trough the debugger. </p>
  
  <pre><code>checkIfSettingsWork("pollin", "31", "14", "on");
  </code></pre>
  
  <p>This is the checkIfSettingsWork function.</p>
  
  <pre><code>function checkIfSettingsWork(protocol, systemcodeSend, unitcode, state) {
      console.log(protocol + systemcodeSend + unitcode + state)
  
  }
  </code></pre>