title: AJAX using jQuery - Syntax Error?
body: <p>The following is the HTML containing the call to the JavaScript function responsible for issuing the AJAX call. I understand that anchor tags are not supposed to have a value attribute but I'm using it with jQuery's .attr("value") method.</p>
  
  <pre><code>&lt;a href="javascript:;" onclick="ajaxTest();" title="Execute AJAX" value="executeAJAX"&gt;Execute AJAX&lt;/a&gt;
  </code></pre>
  
  <p>The following is the JavaScript function. If it is of any significance, it is contained in a .js file all by itself.</p>
  
  <pre><code>function ajaxTest() {
      $.ajax({
          type: "POST",
          url: "doAJAX",
          data: {"selectedScope": "5",
                 "selectedView": "6"},
          dataType: "text",
          success: function(responseData) {
              $("#replaceThis").append(responseData);
          }
      });
  }
  </code></pre>
  
  <p><strong>Everytime the link is clicked, a "syntax error" message appears in Firefox's web console. The JavaScript seems to be working as intended, however.</strong></p>
  
  <p>I just want to understand why I am getting the error.</p>
  
  <p>I should add that I'm using jQuery 1.7.1.</p>
  
  <p>I've performed a search and the only resolution I've found was that the keys for the "data" option should be enclosed in double quotes so I've implemented that but I'm still getting the syntax.</p>
  
  <p>Thanks.</p>
  
  <blockquote>
    <p><strong>EDIT:</strong></p>
    
    <p>Looking at the Firebug console, the code above doesn't trigger an
    error like it did in Firefox's console, however, I saw the following
    in the XML part of the POST Request:</p>
    
    <p><em>XML Parsing Error: syntax error Location:
    moz-nullprincipal:{1d13df07-25fb-4058-9f82-ce1bef3c8949} Line Number
    1, Column 1:<br>
    alskdfjlaksjdfjasdfl<br>
    ^</em></p>
    
    <p>The "alskdfjlaksjdfjasdfl" is simply what I've set up my servlet to return as I test this stuff out.</p>
    
    <p>This is somewhat weird because it seems like jQuery is trying to parse
    the response as XML although I've explicitly stated it to be text.</p>
  </blockquote>