title: jQuery: Use of undefined constant data assumed 'data'
body: <p>I am trying to use jQuery to make a synchronous AJAX post to a server, and get a JSON response back.</p>
  
  <p>I want to set a javascript variable msg upon successful return</p>
  
  <p>This is what my code looks like:</p>
  
  <pre><code>$(document).ready(function(){
      $('#test').click(function(){
      alert('called!');
      jQuery.ajax({
        async: false,
        type: 'POST',
        url: 'http://www.example.com',
        data: 'id1=1&amp;id2=2,&amp;id3=3',
        dataType: 'json',
        success: function(data){ msg = data.msg; },
        error: function(xrq, status, et){alert('foobar\'d!');}
       });
  });
  </code></pre>
  
  <p><strong>[Edit]</strong></p>
  
  <p>I was accidentally mixing PHP and Javascript in my previous xode (now corrected). However, I now get this even more cryptic error message:</p>
  
  <p>uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js</a> :: anonymous :: line 19" data: no]</p>
  
  <p>What the ... ?</p>