title: Parser error with jquery ajax?
body: <p>Here is my code it returns a parser error and fails.</p>
  
  <pre><code>$.ajaxSetup({
    type: 'GET',
    url: 'http://www.example.com/ajax',
    dataType: 'json'
  });
  
  $('#addHotlink').click(function() {
    $('body').after('&lt;div id="lightBox" style="height: ' + htmlHeight + 'px;"&gt;&lt;div&gt;&lt;h3&gt;Choose a name for your hotlink:&lt;img id="lightBoxClose" src="http://www.example.com/images/closedAccordion.png" height="17" width="17" alt="" title="Close this box" /&gt;&lt;/h3&gt;&lt;form id="addHotlinkForm" action="#" method="post" autocomplete="off"&gt;&lt;input id="hotlinkName" type="text" maxlength="15" /&gt;&lt;input class="submit" type="submit" value="Add Hotlink" /&gt;&lt;/form&gt;&lt;/div&gt;&lt;/div&gt;');
    $('#lightBox').hide().fadeIn('fast');
    return false;
  });
  
  $('#addHotlinkForm').live('submit', function(event) {
    event.preventDefault();
  
    var pageURL = window.location.href;  
    var hotlinkName = $('#hotlinkName').val();
  
    if (hotlinkName.length &gt; 0) {
      $.ajax({
        data: {
          hotlinkName: hotlinkName, 
          hotlinkURL: pageURL
        },
        success: function() {
  
          alert('Your hotlink ' + hotlinkName + ' has been inserted to the url: ' + pageURL);
        },
        error: function (ajaxOptions, thrownError) {
  
          alert(thrownError);
          alert('Var hotlinkName: ' + hotlinkName + ' Var hotlinkURL: ' + pageURL);
        }
      });
    }
  });
  </code></pre>
  
  <p>I get a parser error when it tries to execute? Although in the error function the values are being returned as:</p>
  
  <p>hotlinkName: Text entered into box,</p>
  
  <p>hotlinkURL: The current address of page (http://www.example.com/home)</p>
  
  <p>Why is this not working? I have tried changing the type to POST and it still doesn't work?</p>
  
  <p>Here is a fiddle of what I am trying to do, but of course it fails as it is not linked to any ajax sheet.</p>
  
  <p><a href="http://jsfiddle.net/novactown/QsDVe/" rel="nofollow">http://jsfiddle.net/novactown/QsDVe/</a></p>